1. 21 Mar, 2016 4 commits
    • Michael Lee's avatar
      Have StringTest use PRI*64 instead · 948ec49b
      Michael Lee authored
      Summary: This helps account for 32-bit vs. 64-bit compilation targets.
      
      Reviewed By: benyl
      
      Differential Revision: D3076523
      
      fb-gh-sync-id: 56f49daaf55d242ac48f8b8d38a40c6d6230818b
      shipit-source-id: 56f49daaf55d242ac48f8b8d38a40c6d6230818b
      948ec49b
    • Anirudh Ramachandran's avatar
      Add option to retrieve hex representation of client ciphers · c7087eb7
      Anirudh Ramachandran authored
      Summary: A more compact hex representation of ciphers in ClientHello can be useful, e.g., for logging.
      
      Reviewed By: knekritz
      
      Differential Revision: D3052308
      
      fb-gh-sync-id: beaf6fcd4705d4d7fae652d8d8b95b52ca9e07a9
      shipit-source-id: beaf6fcd4705d4d7fae652d8d8b95b52ca9e07a9
      c7087eb7
    • Christopher Dykes's avatar
      Add Windows support to portability/Memory.h · 5b48f33a
      Christopher Dykes authored
      Summary: This adds Windows support to portability/Memory.h and also does some refactoring to be more correct about when to use posix_memalign, and also changes it to fall back to memalign rather than posix_memalign.
      
      Reviewed By: mzlee
      
      Differential Revision: D3069990
      
      fb-gh-sync-id: 88861583c6028e9fb02a3e3804bd6d476956c555
      shipit-source-id: 88861583c6028e9fb02a3e3804bd6d476956c555
      5b48f33a
    • Giuseppe Ottaviano's avatar
      Optimize fbstring::append() · 60088aaa
      Giuseppe Ottaviano authored
      Summary:Instead of relying on `push_back()` to guarantee exponential growth,
      delegate to `expand_noinit`. This removes the duplication of logic
      between the two functions, and significantly speeds up short appends.
      
      ```
      $ _bin/folly/test/fbstring_benchmark_using_jemalloc --bm_min_usec=100000
                                                                Before:             After:
      ============================================================================ ===================
      ./folly/test/FBStringTestBenchmarks.cpp.h       relative  time/iter  iters/s  time/iter  iters/s
      ============================================================================ ===================
      ...
      BM_push_back_fbstring(1)                                     7.51ns  133.20M     6.87ns  145.49M
      BM_push_back_fbstring(23)                                  175.08ns    5.71M   173.92ns    5.75M
      BM_push_back_fbstring(127)                                 586.02ns    1.71M   585.70ns    1.71M
      BM_push_back_fbstring(1024)                                  3.30us  302.81K     3.41us  293.13K
      BM_short_append_fbstring(23)                               367.01ns    2.72M   179.45ns    5.57M
      BM_short_append_fbstring(1024)                               9.33us  107.20K     5.72us  174.95K
      ...
      ============================================================================ ===================
      ```
      
      Reviewed By: philippv
      
      Differential Revision: D3075249
      
      fb-gh-sync-id: 497775ba3fc707bf50821a3cf10fb9d247b9352d
      shipit-source-id: 497775ba3fc707bf50821a3cf10fb9d247b9352d
      60088aaa
  2. 20 Mar, 2016 3 commits
    • Christopher Dykes's avatar
      Add features to portability/Config.h · d05711c6
      Christopher Dykes authored
      Summary: It is perfectly reasonable to need to feature macros when checking configuration, and the configuration is needed to know if features.h exists, so put it in the same file.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3072255
      
      fb-gh-sync-id: 0f253dd1fa2f4a95adb11f11c45e6b86ef9c25bc
      shipit-source-id: 0f253dd1fa2f4a95adb11f11c45e6b86ef9c25bc
      d05711c6
    • Christopher Dykes's avatar
      Split iovec out of SysUio.h · d4d47023
      Christopher Dykes authored
      Summary: This is needed to avoid a circular dependency.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3072037
      
      fb-gh-sync-id: 546a46fd68f25f0c5b027d4d938335b2711d8fdd
      shipit-source-id: 546a46fd68f25f0c5b027d4d938335b2711d8fdd
      d4d47023
    • Mark Reitblatt's avatar
      fix typo in log printing in AsyncSSLSocket · 38db78ab
      Mark Reitblatt authored
      Reviewed By: pritamdamania
      
      Differential Revision: D3068807
      
      fb-gh-sync-id: 0b45ab678e2ec5565eb379540576527cf8b1d308
      shipit-source-id: 0b45ab678e2ec5565eb379540576527cf8b1d308
      38db78ab
  3. 19 Mar, 2016 1 commit
  4. 18 Mar, 2016 1 commit
    • Christopher Dykes's avatar
      Create the sys/mman.h portability header · 6346da0d
      Christopher Dykes authored
      Summary: Something that Windows very definitely lacks. This is a fun one.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D2979661
      
      fb-gh-sync-id: e23c1db0cb8655b22308b874bd421a7cc1e4759e
      shipit-source-id: e23c1db0cb8655b22308b874bd421a7cc1e4759e
      6346da0d
  5. 17 Mar, 2016 3 commits
    • Yedidya Feldblum's avatar
      Remove pthread_yield support · 2c8de414
      Yedidya Feldblum authored
      Summary:[Folly] Remove `pthread_yield` support.
      
      * It is not actually part of POSIX - rather, `sched_yield` is.
      * In C++, we should be using `std::this_thread::yield` anyway.
      
      Reviewed By: Gownta
      
      Differential Revision: D3056221
      
      fb-gh-sync-id: 2fea55dd7b715149327987d61e5a573ad0455330
      shipit-source-id: 2fea55dd7b715149327987d61e5a573ad0455330
      2c8de414
    • Subodh Iyengar's avatar
      Allow override of session context · 1e9f3465
      Subodh Iyengar authored
      Summary:We currently set the session context to the
      default of common name, this allows session
      context to be set to a different value
      for different applications
      
      Reviewed By: ngoyal
      
      Differential Revision: D3059769
      
      fb-gh-sync-id: 185afeb487c2c62dcf44f96076bd05871692c7ab
      shipit-source-id: 185afeb487c2c62dcf44f96076bd05871692c7ab
      1e9f3465
    • Andrew Cox's avatar
      Tell ASAN about fiber stacks · 2ea64dd2
      Andrew Cox authored
      Summary:ASAN needs to know about the stack extents. Currently it has no knowledge of
      fibers and so it can give false positives, particularly in cases of no-return
      (think exceptions).
      
      See: https://github.com/google/sanitizers/issues/189
      
      This change along with a related ASAN diff fixes that, and I've verified it
      fixes false positive test failures I'm seeing when throws happen from fibers.
      
      Also rips out some hacks that attempted to work around the limitations of
      ASAN these changes should fix.
      
      This change depends on:
      D3017630
      D2952854
      D3017619
      
      And will also depend on rollout of libasan.so to /usr/local/fbcode platform dirs on all machines.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D2952899
      
      fb-gh-sync-id: 19da779227c6c0f30c5755806325aa4cba364cfe
      shipit-source-id: 19da779227c6c0f30c5755806325aa4cba364cfe
      2ea64dd2
  6. 16 Mar, 2016 4 commits
    • Christopher Dykes's avatar
      Create portability/Config.h · d9e0b59d
      Christopher Dykes authored
      Summary: Because including the root portability header just to get a couple of defines to be able to enable things is a waste. In addition, it would be nice if the config defines are never needed outside of the portability headers.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3059651
      
      fb-gh-sync-id: 1cb9910d850ea015616a598808556b4815b3fb74
      shipit-source-id: 1cb9910d850ea015616a598808556b4815b3fb74
      d9e0b59d
    • Eric Niebler's avatar
      move StaticMeta::onThreadExit into libfolly_thread_local.so · 946d061d
      Eric Niebler authored
      Summary: Fix folly/test:thread_local_test in the shared library scenario by moving onThreadExit into libfolly_thread_local.so, avoiding the crash when a user's .so is dlclosed.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D2919287
      
      fb-gh-sync-id: ecc4220fd40203289366eb1a6391b8b6d971e65f
      shipit-source-id: ecc4220fd40203289366eb1a6391b8b6d971e65f
      946d061d
    • Phil Willoughby's avatar
      Remove `using std::make_unique` · fed5dff0
      Phil Willoughby authored
      Summary: Older compilers do not have have `std::make_unique`. We have `folly::make_unique` which does the same job, and because we already have `using namespace folly` in this file it suffices to erase the `using std::make_unique` line.
      
      Reviewed By: eduardosuarez
      
      Differential Revision: D3058089
      
      fb-gh-sync-id: a5a5eb54e2bc0ba7ef0880f2b5680a79d1f41d37
      shipit-source-id: a5a5eb54e2bc0ba7ef0880f2b5680a79d1f41d37
      fed5dff0
    • Yedidya Feldblum's avatar
      Remove an outdated/inapplicable comment · 2eba4703
      Yedidya Feldblum authored
      Summary: [Folly] Remove an outdated/inapplicable comment from `folly/Portability.h`.
      
      Reviewed By: Gownta
      
      Differential Revision: D3055909
      
      fb-gh-sync-id: c17fdcc7de13fe5a9bb38bb4498a006ec71a61e2
      shipit-source-id: c17fdcc7de13fe5a9bb38bb4498a006ec71a61e2
      2eba4703
  7. 15 Mar, 2016 5 commits
    • Christopher Dykes's avatar
      Add portability header for sys/file.h · 30c8cd93
      Christopher Dykes authored
      Summary: We don't have it on Windows :(
      
      Reviewed By: yfeldblum
      
      Differential Revision: D2978397
      
      fb-gh-sync-id: 388bc450ce269559825ebfb78e3646533c2e1153
      shipit-source-id: 388bc450ce269559825ebfb78e3646533c2e1153
      30c8cd93
    • Igor Sugak's avatar
      folly/subprocess: fix one -Wsign-conversion and clag 3.9 test · 8c3d9fba
      Igor Sugak authored
      Summary:easy:
      `options.parentDeathSignal_` is `int`, and second argument of `prctl` is `unsigned long`. Adding explicit cast.
      
      hard:
      this change is fixing a real problem when building folly with Clang 3.9.0. The [[ https://github.com/llvm-mirror/clang/commit/f4ddf94ecbd9899a497151621f3871545e24e93b | new alignment implementation ]] in `-O3` generates code that breaks folly's `ParentDeathSubprocessTest.ParentDeathSignal`.
      For the following snipped of code:
      ```lang=cpp
        if (options.parentDeathSignal_ != 0) {
          if (prctl(PR_SET_PDEATHSIG, options.parentDeathSignal_, 0, 0, 0) == -1) {
            return errno;
          }
        }
      ```
      LLVM generates the following assembly:
      ```lang=asm
         0x000000000040a77b <+347>:   mov    0x28(%r14),%rsi
         0x000000000040a77f <+351>:   test   %esi,%esi
         0x000000000040a781 <+353>:   je     0x40a7a1 <folly::Subprocess::prepareChild(folly::Subprocess::Options const&, __sigset_t const*, char const*) const+385>
         0x000000000040a783 <+355>:   mov    $0x1,%edi
         0x000000000040a788 <+360>:   xor    %edx,%edx
         0x000000000040a78a <+362>:   xor    %ecx,%ecx
         0x000000000040a78c <+364>:   xor    %r8d,%r8d
         0x000000000040a78f <+367>:   xor    %eax,%eax
         0x000000000040a791 <+369>:   callq  0x405ad0 <prctl@plt>
      ```
      `%rsi` is a 64-bit register, on the line 1 value of `0x28(%r14)` is loaded to this register. That address points to `options.parentDeathSignal_`, which is a 32-bit value, set to 10 somewhere in a test. After that load:
      ```
      rsi            0x7f000000000a
      ```
      Notice it is not 10 (0xa), there is some garbage value in the upper part of the register. On the line 2, the lower part of this register is checked if it is zero, which corresponds to the first if statement. Then lines 4-8 prepare for `prctl` call. The value of the second argument is passed via `%rsi`, but the upper 32 bits were not cleared. This makes the function call generate `Invalid argument` error.
      With the added explicit cast, notice a call `movslq %eax,%rsi`, which moves a signed 32-bit value of `%eax` (which contains `options.parentDeathSignal_`) to unsigned 64-bin `%rsi`:
      ```
         0x000000000040a77b <+347>:   mov    0x28(%r14),%rax
         0x000000000040a77f <+351>:   test   %eax,%eax
         0x000000000040a781 <+353>:   je     0x40a7a4 <folly::Subprocess::prepareChild(folly::Subprocess::Options const&, __sigset_t const*, char const*) const+388>
         0x000000000040a783 <+355>:   movslq %eax,%rsi
         0x000000000040a786 <+358>:   mov    $0x1,%edi
         0x000000000040a78b <+363>:   xor    %edx,%edx
         0x000000000040a78d <+365>:   xor    %ecx,%ecx
         0x000000000040a78f <+367>:   xor    %r8d,%r8d
         0x000000000040a792 <+370>:   xor    %eax,%eax
         0x000000000040a794 <+372>:   callq  0x405ad0 <prctl@plt>
      ```
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3051611
      
      fb-gh-sync-id: fc0f809bc4be0eed79dc5a701717efa27fedc022
      shipit-source-id: fc0f809bc4be0eed79dc5a701717efa27fedc022
      8c3d9fba
    • Phil Willoughby's avatar
      Convert a polling loop to a futex wait · d43e710c
      Phil Willoughby authored
      Summary:Add a new method to MPMCQueue:
      ```
      template <class Clock, typename... Args>
        bool tryWriteUntil(const std::chrono::time_point<Clock>& when,
                           Args&&... args) noexcept
      ```
      This allows you to write producers which terminate reliably in the absence of consumers.
      
      Returns `true` if `args` was enqueued, `false` otherwise.
      
      `Clock` must be one of the types supported by the underlying call to `folly::detail::Futex::futexWaitUntil`; at time of writing these are `std::chrono::steady_clock` and `std::chrono::system_clock`.
      
      Reviewed By: nbronson
      
      Differential Revision: D2895574
      
      fb-gh-sync-id: bdfabcd043191c149f1271e30ffc28476cc8a36e
      shipit-source-id: bdfabcd043191c149f1271e30ffc28476cc8a36e
      d43e710c
    • Subodh Iyengar's avatar
      Allow httpsession to be movable readCB · f509d73d
      Subodh Iyengar authored
      Summary:Allow HTTPSession to have a movable read
      callback independent of the openssl check.
      
      This allows other downstream transports to
      deliver app data more efficiently.
      
      Reviewed By: w-o-o, knekritz
      
      Differential Revision: D3023517
      
      fb-gh-sync-id: ff27c0e14f7364ad7d7b0028ef740b2678dbcb4c
      shipit-source-id: ff27c0e14f7364ad7d7b0028ef740b2678dbcb4c
      f509d73d
    • Michael Lee's avatar
      Missing guards for FOLLY_TLS in test · f4a80a41
      Michael Lee authored
      Summary:defined(FOLLY_TLS) is guarded once in the test, so we should
      guard for it throughout.  Also a missing header for some platforms.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3049797
      
      fb-gh-sync-id: 5d66c71dda94c57a2e50aee96d55be1c574bf921
      shipit-source-id: 5d66c71dda94c57a2e50aee96d55be1c574bf921
      f4a80a41
  8. 14 Mar, 2016 3 commits
    • Sven Over's avatar
      folly/portability/Constexpr.h: add missing include statement · b1e0c2c8
      Sven Over authored
      Summary:This commit fixes compiler errors when Constexpr.h was included
      on gcc before cstring (or string.h) was included. Also, qualify
      the call to strlen with the std namespace.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3047417
      
      fb-gh-sync-id: 7a50dac2e9449b149062896f34fa5e864f767943
      shipit-source-id: 7a50dac2e9449b149062896f34fa5e864f767943
      b1e0c2c8
    • Michael Lee's avatar
      Fix a typo in portability/Memory.cpp · bddb362e
      Michael Lee authored
      Summary: Also, add error checking back in, and remove the empty WIN32 implementation.
      
      Reviewed By: francis-ma
      
      Differential Revision: D3047494
      
      fb-gh-sync-id: 5a2a18cd1ca675a081ad2a9252c765ab56527b6b
      shipit-source-id: 5a2a18cd1ca675a081ad2a9252c765ab56527b6b
      bddb362e
    • Jimmy Saade's avatar
      folly::FunctionScheduler: Adding capability to reset a function's timer · 13c58db9
      Jimmy Saade authored
      Summary:Adding support for resetting a specified function's timer.
      
      "Resetting a function's timer" effectively means "canceling whatever next runs it would have had, and treating it as though it were just added".
      When `resetFunctionTimer` is called, the specified function's interval (timer) will be reset, and it will execute after its initially-specified `startDelay`. If the `startDelay` is zero, the function will execute immediately, and then be scheduled as before - once every `interval` milliseconds.
      
      Motivation: batch processing of updates, where both a size and time limit are in play. If the size limit is reached, it makes sense to reset the timer for the scheduled function.
      
      Differential Revision: D3045868
      
      fb-gh-sync-id: a5ceb0069c04a77fdab16b61679987ee55484e89
      shipit-source-id: a5ceb0069c04a77fdab16b61679987ee55484e89
      13c58db9
  9. 13 Mar, 2016 1 commit
    • Giuseppe Ottaviano's avatar
      Fix warning in MicroLock initialization · 1c15b5bb
      Giuseppe Ottaviano authored
      Summary:The `init()` function uses the previous value of `lock_`, but that is
      uninitialized and the compiler can issue a warning about it. It is
      also potentially undefined behavior because it is not guaranteed that
      the address of `lock_` is taken before `init()` (in which case the it
      would be just an indeterminate value).
      
      Since it is not very useful to initialize only one slot and leave the
      others uninitialized, we can just have a single `init()` that
      zero-initializes all the slots.
      
      Reviewed By: dcolascione
      
      Differential Revision: D3042629
      
      fb-gh-sync-id: de1633b02eb1c891e310f2d5d2cfc5376cd41d5f
      shipit-source-id: de1633b02eb1c891e310f2d5d2cfc5376cd41d5f
      1c15b5bb
  10. 12 Mar, 2016 3 commits
    • Daniel Colascione's avatar
      Explain union safety in MicroLock comment · b29f38a4
      Daniel Colascione authored
      Reviewed By: ot
      
      Differential Revision: D3045850
      
      fb-gh-sync-id: ee19b146c43410d8d8804c9bfe79c3811394b10e
      shipit-source-id: ee19b146c43410d8d8804c9bfe79c3811394b10e
      b29f38a4
    • Wez Furlong's avatar
      folly: fix gflags<->glog configure check ordering · 4bdddb9e
      Wez Furlong authored
      Summary:On systems that do not have gflags or glog installed globally,
      but only locally as static libraries, our configure check failed for
      glog because we were checking it prior to gflags.
      
      glog depends on gflags, but when the libraries are static, there is
      no explicit dependency information available and the linker fails.
      
      This resolves the issue by checking for gflags first; this causes
      configure to add an implicit `-lgflags` for the subsequent glog
      tests.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3044138
      
      fb-gh-sync-id: 5e07ce52842c6e4cff796560672bf950e2fafe6c
      shipit-source-id: 5e07ce52842c6e4cff796560672bf950e2fafe6c
      4bdddb9e
    • Michael Lee's avatar
      Remove portability/Stdlib.{h,cpp} · 5ae81138
      Michael Lee authored
      Summary: This was wrong and is like better solved, not with a shim layer, but by not using such a platform-specific function in the first place.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3001253
      
      fb-gh-sync-id: 460cc46b1c9adc3d229a07cb290270f7afbbb1e0
      shipit-source-id: 460cc46b1c9adc3d229a07cb290270f7afbbb1e0
      5ae81138
  11. 11 Mar, 2016 1 commit
    • Michael Lee's avatar
      Adding portability to gating PicoSpinLock. · b1eb6819
      Michael Lee authored
      Summary:PicoSpinLock only works on x86_64, Arm64, and ppc64 (i.e.,
      not 32-bit).  Add a bit of gating so we can continue to run tests and
      use headers when compiling for i386.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D2991328
      
      fb-gh-sync-id: b0d0c229508f65dff62b24fdd9d80c799cd97935
      shipit-source-id: b0d0c229508f65dff62b24fdd9d80c799cd97935
      b1eb6819
  12. 10 Mar, 2016 1 commit
  13. 09 Mar, 2016 5 commits
    • Giuseppe Ottaviano's avatar
      Port easy instances to folly::dynamic::array · e84e7fad
      Giuseppe Ottaviano authored
      Summary:The vast majority of `folly::dynamic` array initializations are
      single-line and with no nested arrays, so we can fix them with a
      syntactic codemod. This also fixes a couple of singletons.
      
      For empty arrays:
      ```
      codemod '((?:folly::)?)(dynamic\s+\w+\s*=\s*)({\s*})' '\1\2\1dynamic::array'
      ```
      
      For non-empty ones:
      ```
      codemod '((?:folly::)?)(dynamic\s+\w+\s*=\s*)(?:{\s*([^{}]+?)\s*})' '\1\2\1dynamic::array(\3)'
      ```
      
      Reviewed By: igorsugak
      
      Differential Revision: D3030338
      
      fb-gh-sync-id: 3e56704a6c6294d6f6270e42a1776d991a7938df
      shipit-source-id: 3e56704a6c6294d6f6270e42a1776d991a7938df
      e84e7fad
    • Kyle Nekritz's avatar
      Add replay safety connector/handler to delay transactions scheduled on a replay-unsafe transport. · d00a7c52
      Kyle Nekritz authored
      Summary: This allows HTTPTransactions to be held back until the transport is replay-safe.
      
      Reviewed By: siyengar
      
      Differential Revision: D2974083
      
      fb-gh-sync-id: 037b14c24a80c828a25e483b6873a8e782af0cb4
      shipit-source-id: 037b14c24a80c828a25e483b6873a8e782af0cb4
      d00a7c52
    • Christopher Dykes's avatar
      Create the sys/stat.h portability header · 44af4e09
      Christopher Dykes authored
      Summary: Windows has it, but it doesn't define lstat, and a few other functions have other names.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3003096
      
      fb-gh-sync-id: e7bc210390d18806c8c89cbc18711bb7a728e12f
      shipit-source-id: e7bc210390d18806c8c89cbc18711bb7a728e12f
      44af4e09
    • Kyle Nekritz's avatar
      Make Bits.h respect FOLLY_HAVE_UNALIGNED_ACCESS. · d7a2b20b
      Kyle Nekritz authored
      Summary: This was causing a bunch of SIGBUS's on ARM platforms.
      
      Reviewed By: yfeldblum, mzlee
      
      Differential Revision: D3013458
      
      fb-gh-sync-id: 6d3f60c3f59d16cd3454e3a4231b967e5378724a
      shipit-source-id: 6d3f60c3f59d16cd3454e3a4231b967e5378724a
      d7a2b20b
    • Anirudh Ramachandran's avatar
      SSL cleanup: moving some OpenSSL definitions to new dir folly/io/async/ssl · 4700a31c
      Anirudh Ramachandran authored
      Summary:SSLContext and AsyncSSLSocket are growing with a lot of code that is
      OpenSSL-specific, and it may be good to refactor some of these before it gets
      out of hand.
      
      This is also useful to reduce complexity as we some additional features such as ServerHello parsing and TLS Cached Info (D2936570)
      
      Main changes:
       * Created a subdirectory folly/io/async/ssl to refactor code from folly/io/async. We may want to consider moving this out of folly/io/async
       * Moved OpenSSLPtrTypes.h to folly/io/async/ssl/OpenSSLPtrTypes.h
       * Moved 'OpenSSLUtils' from SSLContext to separate file OpenSSLUtils.{h,cpp}
       * Moved TLSExtensions and ClientHelloInfo from AsyncSSLSocket to TLSDefinitions.h
      
      Reviewed By: siyengar
      
      Differential Revision: D2978707
      
      fb-gh-sync-id: a21f02947aeffccc447da2124a91cc99315df1c7
      shipit-source-id: a21f02947aeffccc447da2124a91cc99315df1c7
      4700a31c
  14. 07 Mar, 2016 3 commits
    • Nathan Bronson's avatar
      minor tweak to MicroLock slow path · e756d07c
      Nathan Bronson authored
      Summary:This diff uses the x86 "pause" instruction or its equivalent when
      spinning in the MicroLock slow loop.  This gives a hint to the processor
      that it should devote more resources to the other execution contexts
      sharing the same core.  This diff also removes an mfence on x86 by using
      a slightly stronger memory model on the preceding compare_exchange_weak,
      and switches to a more portable way of invoking sched_yield().
      
      Reviewed By: dcolascione
      
      Differential Revision: D3018568
      
      fb-gh-sync-id: 02e0ab3a9d9bb9901eddf54e45b71cbb7758a227
      shipit-source-id: 02e0ab3a9d9bb9901eddf54e45b71cbb7758a227
      e756d07c
    • Giuseppe Ottaviano's avatar
      Deprecate dynamic::dynamic(std::initializer_list<dynamic>) · 07dc3ce5
      Giuseppe Ottaviano authored
      Summary:After DR95 the single braces dispatch to the copy constructor
      (http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1467),
      so it is not possible anymore to initialize a singleton dynamic array
      using the braces syntax. The initializer list constructor already had
      a special case for empty lists, which unconditionally called the
      default constructor if defined.
      
      This diff deprecates the braces syntax and defines the following alternative:
      ```
      dynamic empty = dynamic::array;
      dynamic a = dynamic::array(1, 2, "foo");
      ```
      
      Reviewed By: luciang, yfeldblum
      
      Differential Revision: D3013423
      
      fb-gh-sync-id: a0cf09dfd96e9806044f7c3bf3592c637a9bc932
      shipit-source-id: a0cf09dfd96e9806044f7c3bf3592c637a9bc932
      07dc3ce5
    • Michael Lee's avatar
      Guard Getcpu in test. · b873a628
      Michael Lee authored
      Summary:Guarding this the same way it is done in
      detail/CacheLocality.cpp
      
      Reviewed By: yfeldblum
      
      Differential Revision: D3013288
      
      fb-gh-sync-id: a1cc65cccc5cdf32339a739853c27a11ecd98ba0
      shipit-source-id: a1cc65cccc5cdf32339a739853c27a11ecd98ba0
      b873a628
  15. 05 Mar, 2016 2 commits
    • Christopher Dykes's avatar
      Create the Windows portability header · f3605199
      Christopher Dykes authored
      Summary: Because Windows' defines seem to get in the way more than they help.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D2989507
      
      fb-gh-sync-id: 148f390ef6adf977bffa2262aa76839b2bf4f507
      shipit-source-id: 148f390ef6adf977bffa2262aa76839b2bf4f507
      f3605199
    • Yedidya Feldblum's avatar
      A warning for the portability headers · 22a8195e
      Yedidya Feldblum authored
      Summary: [Folly] A warning for the `portability` headers.
      
      Reviewed By: mzlee, Orvid, meyering
      
      Differential Revision: D3014442
      
      fb-gh-sync-id: f6557d8021dc2a50a656685492d717fdbff1124a
      shipit-source-id: f6557d8021dc2a50a656685492d717fdbff1124a
      22a8195e