1. 15 Nov, 2016 4 commits
  2. 14 Nov, 2016 1 commit
  3. 13 Nov, 2016 1 commit
    • Subodh Iyengar's avatar
      Add ecdsa smart ptr · 4c7d5226
      Subodh Iyengar authored
      Summary: Add ecdsa smart ptr.
      
      Reviewed By: knekritz
      
      Differential Revision: D4173310
      
      fbshipit-source-id: abd5f799b3414b70128635c4390af6f2de329e11
      4c7d5226
  4. 12 Nov, 2016 5 commits
    • Andrii Grynenko's avatar
      Move runAfterDelay/tryRunAfterDelay into TimeoutManager · ab60aed9
      Andrii Grynenko authored
      Summary: This is useful to add more TimeoutManager implementations.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4164236
      
      fbshipit-source-id: 5f2057f6ebfbdc971bc0b5594e3bc4b5a337aaef
      ab60aed9
    • Marcin Pawlowski's avatar
      try to improve folly/io/async/test:async_test - AsyncSocketTest.Write · 8c88eb0a
      Marcin Pawlowski authored
      Summary:
      the test fails a lot as seen on the task.
      To kill the connection in said test, we depeneded
      on destructor, however this uses a delayed destruction
      patter so I guess we did not destroy on time and
      we were failing the tests.
      I close socket explicitly. No idea if this misses
      the point of whole test.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4171111
      
      fbshipit-source-id: 01b8c97a04a2bcdfaeeea522ca8bcae343d6bb5d
      8c88eb0a
    • Mirek Klimos's avatar
      Revert DLOG_INFO warnings about RequestContext being overriden · 8e312461
      Mirek Klimos authored
      Summary: This is causing a log spew on some services, let's remove it until we figure out where the problem is and fix
      
      Differential Revision: D4171379
      
      fbshipit-source-id: 2afdab6917a2498c376559f9171f6e93ab9c8ad7
      8e312461
    • Andrii Grynenko's avatar
      Make Observer.Stress test not fail under load · 5b8add09
      Andrii Grynenko authored
      Reviewed By: marcinpe
      
      Differential Revision: D4171655
      
      fbshipit-source-id: e6ef33c50d5d91e05250520171c959a893470460
      5b8add09
    • Martin Martin's avatar
      When you read from a default-constructed MPMCQueue, assert instead of SIGFPE. · 8712f361
      Martin Martin authored
      Summary:
      I accidentally forgot to specify the capacity for my
      MPMCQueue.  When I then did a blockingRead(), I got a SIGFPE.  Thanks
      to a custom signal handler that doesn't print stack traces, and a few
      more comedy of errors, I lost a day to this.  With this patch, I would
      have gotten an assertion failure instead.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4169033
      
      fbshipit-source-id: fab97ea0d5afc3c06885758b31a5e8c91ae75a45
      8712f361
  5. 11 Nov, 2016 4 commits
    • Mirek Klimos's avatar
      Add warnings when overriding RequestContext · 1d2d4f32
      Mirek Klimos authored
      Summary: We currently store the previous value on creation of RequestContextScopeGuard and reset it to the previous one when it goes out of scope - this means that if it's not unset properly somewhere, we'll prolong its life by saving it and restoring later. We need to do this because of some edge cases but a RequestContext should generally never be overridden by a different RequestContext - let's add a warning if this happens
      
      Reviewed By: djwatson, palmtenor
      
      Differential Revision: D3971904
      
      fbshipit-source-id: e72b5f01102d18977d8aa5f8dca5a7802545098a
      1d2d4f32
    • Andrew Gallagher's avatar
      folly/test/SingletonTestStructs: move inlined function to impl file · d07b730b
      Andrew Gallagher authored
      Reviewed By: yfeldblum
      
      Differential Revision: D4162763
      
      fbshipit-source-id: 25c9bfae2e7679f4b98a3d64ee9f2319eb6e7f4a
      d07b730b
    • Yedidya Feldblum's avatar
      Let folly::range(const std::array<...>&) be constexpr · b2bd22d3
      Yedidya Feldblum authored
      Summary:
      [Folly] Let `folly::range(const std::array<...>&)` be `constexpr`.
      
      This may be useful for future work.
      
      Reviewed By: simpkins
      
      Differential Revision: D4165608
      
      fbshipit-source-id: 8f1064c3cdc07301e198acd596ff26724d603cdd
      b2bd22d3
    • Jim Meyering's avatar
      folly/Foreach.h: fix FOR_EACH_R and FOR_EACH_KV to avoid shadowing warnings · 1dee6ec9
      Jim Meyering authored
      Summary:
      Fix these macros not to self-shadow for nested uses.
      How? Make each local variable name include __LINE__.
      This works in most cases, but not all: if you put the
      nested uses all on one line, you'll still get shadowing warnings.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4161553
      
      fbshipit-source-id: 9e11ae6778272c733a4c820cfb30c5db59998a5b
      1dee6ec9
  6. 10 Nov, 2016 5 commits
    • Christopher Dykes's avatar
      Always use inline-asm version on GCC/Clang · 7213df65
      Christopher Dykes authored
      Summary:
      Because the intrinsic version requires explicitly adding `__target__` attributes, which results in things not being inlined. Although the code generated with the `__target__` attribute is strictly better, ensuring it's applied on all the relevant functions is error-prone, so just use the inline assembly version for GCC/Clang so that it can be inlined elsewhere. MSVC will inline the intrinsic version without any issue.
      This also marks the functions as `ALWAYS_INLINE`, as the diff that is getting reverted made that change as well.
      
      Reviewed By: yfeldblum, philippv, ot
      
      Differential Revision: D3963935
      
      fbshipit-source-id: 47175d64e7be351eb455a4d053b91ce9392bf152
      7213df65
    • Tudor Bosman's avatar
      Add include files necessary to use symbolizer · f588dc4a
      Tudor Bosman authored
      Summary:
      Some include files are not installed, causing including symbolizer/Symbolizer.h to fail.
      Closes https://github.com/facebook/folly/pull/512
      
      Reviewed By: philippv
      
      Differential Revision: D4161113
      
      Pulled By: luciang
      
      fbshipit-source-id: 5a5f8577f8d84ba33f89073781d374b99ba37df6
      f588dc4a
    • Christopher Dykes's avatar
      Don't try to call _free_osfhnd when not compiling agains the static CRT · a9adcd15
      Christopher Dykes authored
      Summary:
      Because, unfortunately, it isn't exported from the dynamic CRT dlls :(
      There's not really a nice way to handle this when using the dynamic CRT without doing very fragile hocus-pocus that relies on the exact layout and implementation details of the file descriptor table in the CRT, so the best we can really do is close the socket and just let the file descriptor itself leak.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4156558
      
      fbshipit-source-id: 32cb4bf357f6746cf6597b66649ff9f018fb1bed
      a9adcd15
    • Phil Willoughby's avatar
      Use std::cerr for folly/Singleton.cpp error printing · a500df07
      Phil Willoughby authored
      Summary:
      Create a local std::ios_base::Init instance to ensure that it is valid, then
      use std::cerr.
      
      Reviewed By: yfeldblum, nbronson
      
      Differential Revision: D4139681
      
      fbshipit-source-id: 03377dd417710e320a6b53298d507fd0168592f6
      a500df07
    • Andrii Grynenko's avatar
      Fix wrong use of upgrade lock · 0416e1ea
      Andrii Grynenko authored
      Reviewed By: yfeldblum, nbronson
      
      Differential Revision: D4149681
      
      fbshipit-source-id: 37bd1b0b7d1ad6e6fa813228307abebfe772012f
      0416e1ea
  7. 09 Nov, 2016 8 commits
  8. 08 Nov, 2016 3 commits
    • Christopher Dykes's avatar
      Make NeedleFinderTest::Needles256 actually do things · 4aa69c20
      Christopher Dykes authored
      Summary:
      The min value of a `char` is `-128`, but we're initializing our `size_t` i's with it, so, as MSVC quite rightly warns (as C6294) the condition is never true and the loop never loops.
      Fix it by signing our i's.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4145419
      
      fbshipit-source-id: 87591d0f84c54472b1b5847e025d091de3f98bca
      4aa69c20
    • James Sedgwick's avatar
      add tryReadUntil and make fixes along the way · 5eb31cb3
      James Sedgwick authored
      Summary:
      this diff adds tryReadUntil, which is a mirror of tryWriteUntil in both function and implementation.
      Two bugs were exposed in the process of implementing and testing tryWriteUntil; they are fixed as well and are as follows:
        1. tryObtainPromisedPopTicket didn't assign to the passed ticket return reference in the failure case
        2. TurnSequencer::tryWaitForTurn() didn't distinguish between past turns and timeouts in the failure case; they need to be
           differentiated because SingleElementQueue::tryWaitFor{De/En}queue() should only fail in the timeout case, not if the turn has passed.
      
      The two added unit tests are admittedly clumsy, but making the obvious simplifications to them keeps them from triggering the premature timeout race caused by bug 2 above, so I kept them as is.
      
      Reviewed By: magedm
      
      Differential Revision: D4050515
      
      fbshipit-source-id: b0a3dd894d502c44be62d362ea347a1837df4c2f
      5eb31cb3
    • Andrew Gallagher's avatar
      Mark implicitly inlined static locals with default visibility · 782325fd
      Andrew Gallagher authored
      Summary:
      These functions contain static locals which need to be exported to
      the global dynamic symbol table to get deduplicated at runtime.  Since
      using `-fvisibility-inlines-hidden` demotes the visibility of these
      static locals, explicitly tag them.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4139154
      
      fbshipit-source-id: 08b81721c6c945ac5556472481ae771d0eeb5f88
      782325fd
  9. 07 Nov, 2016 2 commits
    • Stepan Palamarchuk's avatar
      Remove noexcept from AsyncSocket::prepareReadBuffer · 5c52b281
      Stepan Palamarchuk authored
      Summary:
      `prepareReadBuffer` is calling a callback function that is not a noexcept
      also `prepareReadBuffer` is being called only from one place, that wraps this function call with try/catch.
      
      Reviewed By: jmswen
      
      Differential Revision: D4138424
      
      fbshipit-source-id: a05bdd6f741761567a7d0291017c285b0bf15522
      5c52b281
    • Andrew Gallagher's avatar
      Annotate some static locals as "library-local" · 5d52fb8c
      Andrew Gallagher authored
      Summary:
      This tags certain static locals, wich may get duplicated via dynamic
      linking and inlining, as safe to have multiple copies at runtime,
      making this subtle behavior explicit.
      
      Reviewed By: igorsugak
      
      Differential Revision: D4082929
      
      fbshipit-source-id: ba4e23cb121e957a43f5659a1ca3432cb89cb8f3
      5d52fb8c
  10. 06 Nov, 2016 1 commit
    • Yedidya Feldblum's avatar
      Let folly::range be constexpr · 621adb9c
      Yedidya Feldblum authored
      Summary:
      [Folly] Let `folly::range` be `constexpr`.
      
      It will be useful to have this helper function be `constexpr` to support further compile-time code.
      
      Reviewed By: juchem
      
      Differential Revision: D4135943
      
      fbshipit-source-id: a62be93f9e492ca302130d1a3b190ed4b69f7a80
      621adb9c
  11. 05 Nov, 2016 1 commit
  12. 04 Nov, 2016 2 commits
    • Zach Amsden's avatar
      Add StringKeyedMap/Set.h to OSS build · 7dd7fd99
      Zach Amsden authored
      Summary: Eden uses this and won't build with OSS folly without it.
      
      Reviewed By: Orvid
      
      Differential Revision: D4132103
      
      fbshipit-source-id: 68d6c7dc642a7401eca60b0713db9f90cc11ced1
      7dd7fd99
    • Mirek Klimos's avatar
      Trying to improve the efficiency of RequestContext callbacks · 245489e2
      Mirek Klimos authored
      Summary: Changed RWSpinLock to a SharedMutex in the RequestContext to see if this would lower the overhead of the onSet/onUnset callbacks.
      
      Reviewed By: djwatson
      
      Differential Revision: D3780396
      
      fbshipit-source-id: 3d91f8194357533072fe053d23e0454a36faecff
      245489e2
  13. 03 Nov, 2016 3 commits
    • Kyle Nekritz's avatar
      Add splitAtMost to IOBufQueue. · 4b4183ce
      Kyle Nekritz authored
      Summary: This allows getting up to n bytes from the queue without first having to check the length.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D4083484
      
      fbshipit-source-id: 2a468992c97f036c22f1a0d9f830e6d5286a4bc2
      4b4183ce
    • Kyle Nekritz's avatar
      Allow folly::io::Cursor to move backwards. · 564c79af
      Kyle Nekritz authored
      Summary: This is helpful for parsing data IOBufs in reverse.
      
      Reviewed By: siyengar
      
      Differential Revision: D4082810
      
      fbshipit-source-id: 6a201d25e7d22befe28f92e4a1d7aa41ad7d6817
      564c79af
    • Louis Brandy's avatar
      quiet -Wmaybe-uninitialized · 60ebafb4
      Louis Brandy authored
      Summary: gcc-4.9 doesn't appreciate this clever loop and worries about `prev` being uninitialized on first use. Assuming the rest of the program behaves properly and preserves the invariant this code is expecting, this isn't bugged. But let's initialize it anyway.
      
      Reviewed By: meyering
      
      Differential Revision: D4120746
      
      fbshipit-source-id: 1a7c323a4b6296a81768a62dd7d72337c5c35bf0
      60ebafb4