1. 13 Oct, 2015 5 commits
    • Igor Sugak's avatar
      folly: fix build with clang 3.6 -Werror · 498bc465
      Igor Sugak authored
      Summary: Fix a few `-Wsign-compare` violations
      
      Reviewed By: @meyering
      
      Differential Revision: D2527969
      
      fb-gh-sync-id: 140acbd06eedf2e2a315e1927b331ff5efb20d0f
      498bc465
    • Igor Sugak's avatar
      folly: fix clang -Wpessimizing-move · a2bab0fb
      Igor Sugak authored
      Summary: Make folly `-Wpessimizing-move` clean:
      
      Common errors:
      ```lang=bash
      folly/io/test/NetworkBenchmark.cpp:71:30: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
          unique_ptr<IOBuf> next = std::move(head->pop());
                                   ^
      folly/io/IOBufQueue.cpp:153:28: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
            appendToChain(head_, std::move(
                                 ^
      folly/IPAddressV6.cpp:341:12: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
          return std::move(ip);
                 ^
      folly/IPAddressV6.cpp:341:12: note: remove std::move call here
          return std::move(ip);
                 ^~~~~~~~~~  ~
      1 error generated.
      ```
      
      Reviewed By: @fugalh, @meyering
      
      Differential Revision: D2526950
      
      fb-gh-sync-id: 49291a8b49905eb9b2042d004830ff2f599dfbd3
      a2bab0fb
    • Woo Xie's avatar
      add shutdownWrite to wangle for closing socket write only · 09417cff
      Woo Xie authored
      Summary: current wangle has no way to close socket write side. writeFlags is extended so that wangle/AsyncSocketHandler can distinguish closeNow(), closeWithReset() and shutdownWrite()
      
      Reviewed By: @viswanathgs
      
      Differential Revision: D2522056
      
      fb-gh-sync-id: 60616176d78311a4a09f9761a6ccda01dd502a88
      09417cff
    • Ben Maurer's avatar
      SIOF-proof thread local · 2bebe62f
      Ben Maurer authored
      Summary: Right now ThreadLocal & friends don't operate correctly when used as a
      static variable (which is the idiomatic way to use them). The TLS id is
      allocated in the static constructor so anybody who uses the ID prior to
      first use would use an invalid ID. This makes ThreadLocal unusable for core
      code such as per-thread reference counting.
      
      This diff allocates the ID on first use. By making the invalid ID maxint we
      avoid adding any extra branches in the fast path. We can then make the
      constructor a constexpr meaning that initialization will happen prior to
      any code running.
      
      Reviewed By: @meyering
      
      Differential Revision: D2457989
      
      fb-gh-sync-id: 21d0c0d00c638fbbd36148d14d4c891f66f83706
      2bebe62f
    • Ben Maurer's avatar
      Move digits_to into .cpp · fa5d6ef3
      Ben Maurer authored
      Summary: objdump was showing that the shiftXXX tables are being generated each
      time this file is included. For example, HHVM has about 200 of each
      of the 4 tables. Since each one is 512 bytes this is 400 KB. I'm not
      quite sure why this was happening -- I'd think that the linker would
      combine a constant table that was identical.
      
      I think the best thing to do here is just to use extern template. This
      way you there's only one copy of the table and you don't have to parse
      all of this code in every file
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2506571
      
      fb-gh-sync-id: b01a522c536a2ff4136340245cacaa33897afefb
      fa5d6ef3
  2. 10 Oct, 2015 1 commit
  3. 09 Oct, 2015 4 commits
  4. 08 Oct, 2015 1 commit
  5. 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
  6. 06 Oct, 2015 2 commits
  7. 05 Oct, 2015 3 commits
  8. 04 Oct, 2015 1 commit
    • Pavlo Kushnir's avatar
      Fix build · 1638d60d
      Pavlo Kushnir authored
      Summary: title
      
      Reviewed By: @yfeldblum
      
      Differential Revision: D2506703
      1638d60d
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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