1. 07 Oct, 2015 4 commits
    • Bruno Goncalves's avatar
      Fixed #317 - unresolved reference to __atomic_is_lock_free · 60a5636b
      Bruno Goncalves authored
      Summary: Tested in:
      Distro: Fedora 20 - x86_64
      kernel: 3.19
      compiler: gcc version 4.8.3
      Closes https://github.com/facebook/folly/pull/320
      
      Reviewed By: @sgolemon
      
      Differential Revision: D2519083
      
      fb-gh-sync-id: 07b1437326c393c99feeb6e0764d664d3e22faea
      60a5636b
    • Steve O'Brien's avatar
      Singleton: remove dependency on Future · f54fbf88
      Steve O'Brien authored
      Summary: Singletons requires Futures, and Futures indirectly (via HHWheelTimeKeeper) require Singletons.  This breaks the dependency.  It removes a Future-using API which will be replaced with a better alternative.
      
      Reviewed By: @luciang
      
      Differential Revision: D2517807
      
      fb-gh-sync-id: 93df371a74d0f80dc8c55fb0eadd0b688b27b525
      f54fbf88
    • Steve O'Brien's avatar
      Singleton: un-inline initialization-time-only methods · ccbbdd36
      Steve O'Brien authored
      Summary: Move some methods which are generally only used during initialization time (registration, eager-init functions) from the header to the .cpp file
      
      Reviewed By: @luciang
      
      Differential Revision: D2513043
      
      fb-gh-sync-id: 58d1f6e0d158d805a12b8d267421927b3cfc6118
      ccbbdd36
    • Yedidya Feldblum's avatar
      Remove evil using statements from AsyncSSLSocket.h · c12818f9
      Yedidya Feldblum authored
      Summary: [Folly] Remove evil `using` statements from `AsyncSSLSocket.h`.
      
      `using` in headers is frowned upon.
      
      Consider this diff a frown.
      
      Reviewed By: @alandau
      
      Differential Revision: D2509810
      
      fb-gh-sync-id: 4a752b9f4a5be6ac4ca7c498c0168ffad5c35d7f
      c12818f9
  2. 06 Oct, 2015 2 commits
  3. 05 Oct, 2015 3 commits
  4. 04 Oct, 2015 1 commit
    • Pavlo Kushnir's avatar
      Fix build · 1638d60d
      Pavlo Kushnir authored
      Summary: title
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2506703
      1638d60d
  5. 03 Oct, 2015 4 commits
    • Andre Pinto's avatar
      Fix async readme · 3fcb3e09
      Andre Pinto authored
      Summary: AsyncPipe is already open source
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2506476
      3fcb3e09
    • Yedidya Feldblum's avatar
      Fix Build: folly/Range.h for build platforms missing SSE42 headers · 37d40eed
      Yedidya Feldblum authored
      Summary: [Folly] Fix Build: `folly/Range.h` for build platforms missing SSE42 headers.
      
      We make the assumption that if the compiler defines the appropriate symbols indicating SSE42, that the corresponding intrinsics headers are available.
      
      We also remove `Range.cpp` from `Makefile.am`, which we forgot to do in the blamed diff.
      
      Reviewed By: @nbronson
      
      Differential Revision: D2504934
      37d40eed
    • Alexey Spiridonov's avatar
      Add "consume all captured output" callback to CaptureFD · 338a2603
      Alexey Spiridonov authored
      Summary: I noticed myself trying to fake this kind of callback for a log-based test I was writing. It seems much nicer to add the callback to `CaptureFD` than roll ugly wrappers around it to do the same thing.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2506106
      338a2603
    • Yedidya Feldblum's avatar
      Converge folly::make_unique to C++14's std::make_unique · 62504e55
      Yedidya Feldblum authored
      Summary: [Folly] Converge `folly::make_unique` to C++14's `std::make_unique`.
      
      The primary use-case of ther deleter variety of `folly::make_unique` is `DelayedDestruction`. Let the classes matching this use-case define their own factories.
      
      Reviewed By: @fugalh
      
      Differential Revision: D2495718
      62504e55
  6. 02 Oct, 2015 2 commits
    • Yedidya Feldblum's avatar
      Support SSE-enabled Range functions under Clang · 96000632
      Yedidya Feldblum authored
      Summary: [Folly] Support SSE-enabled `Range` functions under Clang.
      
      Basically, we remove GCC-only -isms. In particular, we use only names from the `<emmintrins.h>` and `<smmintrins.h>` headers, instead of the GCC-specific SSE builtins that the original code uses.
      
      But in order to get this to work, we must split out the SSE-enabled functions into their own sources and compile them with the `-msse4.2` flag. There is a way to get around this in GCC by marking individual functions as SEE-enabled, but that technique is not supported in Clang. This is the new `RangeSse42` module.
      
      And in order to do that, we must split out the code that is called by both the original `Range` and the new SSE-enabled functions into yet a third module, `RangeCommon`.
      
      Ahhhhhh, dependencies.
      
      Note that we always compile the SSE-enabled functions, but we only run them on architectures supporting SSE. The original code tests the CPU's capabilities before running any SSE-enabled functions; this change retains that check.
      
      Reviewed By: @nbronson
      
      Differential Revision: D2428983
      96000632
    • Nathan Bronson's avatar
      fix compiler warnings from gcc-4.9 + -Wunused-variable · b05969e4
      Nathan Bronson authored
      Summary: This diff fixes the compiler warnings emitted by gcc-4.9's
      stricter -Wsigned-comparison check, as well as those revealed by
      -Wunused-variable.
      
      Reviewed By: @meyering, @yfeldblum
      
      Differential Revision: D2494514
      b05969e4
  7. 01 Oct, 2015 2 commits
    • Alex Landau's avatar
      thrift-tls: Expose client common name in connection context · 17b973ba
      Alex Landau authored
      Summary: Server can find out client's common name through
      Cpp2ConnContext::getPeerCommonName
      
      Reviewed By: @siyengar
      
      Differential Revision: D2469588
      17b973ba
    • Alecs King's avatar
      fix build · 68b39c30
      Alecs King authored
      Summary: fix typo
      
      jenkins and oss build (e.g. travis) failing.
      
      Reviewed By: @pavlo-fb
      
      Differential Revision: D2499462
      68b39c30
  8. 30 Sep, 2015 5 commits
    • Mohammad Husain's avatar
      APIs to determine which end of the socket has closed it · 0bf69167
      Mohammad Husain authored
      Reviewed By: @afrind
      
      Differential Revision: D2466921
      0bf69167
    • Steve O'Brien's avatar
      folly Symbolizer: fix destruction-order fiasco problem · f04e4550
      Steve O'Brien authored
      Summary: On a (broken) unit test there is a bad `CHECK` during destruction time.  This triggers an ABRT, goes through the signal handler, and in the process ends up doing a use-after-free.
      
      Moved some globals inside the functions in which they are used (w/ little duplication, as they are used in one place, mostly).
      
      Reviewed By: @luciang, @meyering
      
      Differential Revision: D2494046
      f04e4550
    • Dave Watson's avatar
      UpdateableSharedPtr in folly · 1673619a
      Dave Watson authored
      Summary: This diff adds UpdateableSharedPtr and FastUpdateableSharedPtr classes to folly. They are efficiet RCU-style holders for a shared_ptr. See the comment at the top of UpdateableSharedPtr.h for a more detailed description and benchmark results.
      
      All the added files are copied from logdevice code with (almost) no changes (`logdevice/common/` on branch `origin/logdevice-latest`). We've been using them in logdevice for a few months. D1821723 introduced it.
      
      Reviewed By: @​bmaurer
      
      Differential Revision: D1919702
      1673619a
    • Yedidya Feldblum's avatar
      Extract SparseByteSet into its own module · 6daec316
      Yedidya Feldblum authored
      Summary: [Folly] Extract `SparseByteSet` into its own module.
      
      `SparseByteSet`, formerly `FastByteSet`, is actually a generic, fully standalone class. It does not need to be embedded in `Range.cpp`.
      
      Reviewed By: @​bmaurer
      
      Differential Revision: D2460180
      6daec316
    • Ranjeeth Dasineni's avatar
      add callback to specify a client next protocol filter · 14a19db2
      Ranjeeth Dasineni authored
      Summary: From the client perspective, we set the list in order of
      preference once and call into openssl to do the selection. This adds
      a little more flexibility in that client optionally can customize the
      selection for each negotiation. added tests for the no-op case and the
      customized case. Feel free to suggest improvements.
      
      Reviewed By: @afrind
      
      Differential Revision: D2489142
      14a19db2
  9. 29 Sep, 2015 3 commits
    • Subodh Iyengar's avatar
      Pre-prune iobufs from clone · 1f46d8c5
      Subodh Iyengar authored
      Summary: It's pretty common during parsing protocols with cursors
      that there will be empty iobufs along the way.
      
      This changes it so that we prune empty IOBufs in the cloned
      output before returning it to the user.
      
      Reviewed By: @djwatson
      
      Differential Revision: D2464488
      1f46d8c5
    • Andre Pinto's avatar
      Open source AsyncPipe · 2773b36d
      Andre Pinto authored
      Summary: AsyncPipeReader and AsyncPipeWriter are classes to asynchronously
      read and write to pipes.
      
      Reviewed By: @djwatson
      
      Differential Revision: D2479514
      2773b36d
    • Yedidya Feldblum's avatar
      CodeMod apache::thrift::async::TEventBase to folly::EventBase (remainder) · f6f942be
      Yedidya Feldblum authored
      Summary: [Thrift] CodeMod `apache::thrift::async::TEventBase` to `folly::EventBase` (remainder).
      
      A few straggler bits left out of D2349828.
      
      Reviewed By: @Gownta
      
      Differential Revision: D2489063
      f6f942be
  10. 28 Sep, 2015 2 commits
    • Ben Maurer's avatar
      Broke build · 26d9f3f3
      Ben Maurer authored
      Summary: sorry
      
      Reviewed By: @​chiunlin
      
      Differential Revision: D2485925
      26d9f3f3
    • Ben Maurer's avatar
      Easy SIOF-proofing · 739bdb1c
      Ben Maurer authored
      Summary: These classes are likely to be used as static variables and can
      easily be constructed with constexpr.
      
      One that we really ought to fix is SpinLock. Sadly we have a bunch of
      implementations of it some of which need initialization.
      
      Reviewed By: @meyering
      
      Differential Revision: D2459355
      739bdb1c
  11. 25 Sep, 2015 1 commit
    • Steve O'Brien's avatar
      Singleton: refine "eager" initialization · 8f1e662a
      Steve O'Brien authored
      Summary: * `registrationComplete` has a slightly different interface (uses enums now)
      * `void doEagerInit()` method initializes synchronously; `Future<Unit> doEagerInitVia(Executor*)` now available.
      
      Reviewed By: @luciang, @meyering
      
      Differential Revision: D2463464
      8f1e662a
  12. 24 Sep, 2015 3 commits
    • Justin Gibbs's avatar
      emplace() support for AtomicHashArray/Map · 800a6af0
      Justin Gibbs authored
      Summary: Allow objects that only support in-place construction (no copy/move
      constructor) to be stored in AtomicHashMap and AtomicHashArray via the
      emplace() method. This uses variadic template parameters and perfect
      forwarding to allow the arguments for any valid constructor for the
      object to be used during insertion.
      
      Reviewed By: @nbronson
      
      Differential Revision: D2458152
      800a6af0
    • Yedidya Feldblum's avatar
      A qfind_first_byte_of using a bitset in folly/Range.cpp · 9013b5e0
      Yedidya Feldblum authored
      Summary: [Folly] A `qfind_first_byte_of` using a `bitset` in `folly/Range.cpp`.
      
      With additions to the existing benchmark program.
      
      Reviewed By: @nbronson
      
      Differential Revision: D2465890
      9013b5e0
    • James Sedgwick's avatar
      revert D2379210 · ac75bb2d
      James Sedgwick authored
      Summary: This broke EventBase tests, which I managed not to run because they're marked as extended for some reason :( I don't have time to take another stab at this at the moment so I'm reverting for now
      
      Reviewed By: @djwatson
      
      Differential Revision: D2467789
      ac75bb2d
  13. 23 Sep, 2015 3 commits
    • Yedidya Feldblum's avatar
      CpuIdTest.cpp does not need glog · 09312dae
      Yedidya Feldblum authored
      Summary: [Folly] `CpuIdTest.cpp` does not need `glog`.
      
      Reviewed By: @​@​philippv
      
      Differential Revision: D2470503
      09312dae
    • Yedidya Feldblum's avatar
      Search unpadded strings in Range benchmarks · 606fa0b6
      Yedidya Feldblum authored
      Summary: [Folly] Search unpadded strings in `Range` benchmarks.
      
      `vstr` has padding to adjust alignment. `vstrp` is a view into `vstr` that skips the padding, so that searches start out unaligned.
      
      Before this diff, haystack is 8-byte aligned: `uintptr_t(haystack.begin()) % 8 == 0`. After this diff, it is not.
      
      Reviewed By: @​@​nbronson
      
      Differential Revision: D2468934
      606fa0b6
    • Yedidya Feldblum's avatar
      Use constexpr for folly::dynamic::TypeInfo static fields · 178d3b45
      Yedidya Feldblum authored
      Summary: [Folly] Use constexpr for folly::dynamic::TypeInfo static fields
      
      These things are compile-time values. So yeah.
      
      Reviewed By: @​@​JoelMarcey
      
      Differential Revision: D2466270
      178d3b45
  14. 22 Sep, 2015 1 commit
  15. 21 Sep, 2015 4 commits
    • Chip Turner's avatar
      Move definition of strlcpy to outside an #if · e8c07bf4
      Chip Turner authored
      Summary: Looks like some platforms fail to build (open source, not internal) due to #if conditional.
      
      Reviewed By: @ldemailly
      
      Differential Revision: D2464555
      e8c07bf4
    • Subodh Iyengar's avatar
      Fix potential delete behavior of guard · ae59a5e9
      Subodh Iyengar authored
      Summary: There is a potential double free in destructor guard
      if someone calls a method which takes a DG in the destructor
      of the DG.
      
      This is potential in the case when someone is holding onto
      a DG while calling destroy() on the object.
      
      Reviewed By: @djwatson
      
      Differential Revision: D2463113
      ae59a5e9
    • Chip Turner's avatar
      Make strlcpy available in folly, second attempt · 9722033f
      Chip Turner authored
      Summary: strncpy is bad.  strlcpy is somewhat less bad.  We already had
      this function, but let's move it somewhere more reasonable.
      
      This would make sense to live in String.h, but then we have circular
      dependencies.  Since String.h includes Demangle.h, though, you get
      strlcpy by including it, so this should be okay enough.
      
      Reviewed By: @lbrandy
      
      Differential Revision: D2097590
      9722033f
    • Marc Horowitz's avatar
      make to<bool> skip range check · be90fbfb
      Marc Horowitz authored
      Summary: to<bool>(42) should return true, not throw an exception.
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2459766
      be90fbfb