1. 29 Nov, 2018 2 commits
    • Yedidya Feldblum's avatar
      Remove StaticSingletonManager support for creator function · 592b2621
      Yedidya Feldblum authored
      Summary: [Folly] Remove `StaticSingletonManager` support for creator function. In general, derived types may be used instead.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D13114823
      
      fbshipit-source-id: ecd781a1e11f1726e5e8689874e7f4473d21ecb0
      592b2621
    • Yedidya Feldblum's avatar
      Let SingletonHolder call createGlobal with no args · 60c9115b
      Yedidya Feldblum authored
      Summary: [Folly] Let `SingletonHolder` call createGlobal with no args. This was the only non-test call-site calling it with an argumnet.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D13114710
      
      fbshipit-source-id: 55205a69d25966ee9fb09d5daefed1f9ecad80b9
      60c9115b
  2. 28 Nov, 2018 2 commits
    • Jon Maltiel Swenson's avatar
      Remove incorrect call to dcheckIsInEventBaseThread · 9aede428
      Jon Maltiel Swenson authored
      Summary: The point of this diff is that `AsyncSocket::closeNow()` should be able to be called on a socket that is not attached to an event base. Removing an overly protective `dcheckIsInEventBaseThread()` enables this.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13219611
      
      fbshipit-source-id: ca57995e1a96d2b937bccf311d3f6b903abc33b7
      9aede428
    • Orvid King's avatar
      Just define STATUS_HANDLE_NOT_CLOSABLE · 8c7e748d
      Orvid King authored
      Summary: Multiple windows headers define a subset of the full list of status types and it's a mess, so just define the only extra one we need manually to avoid the warning spew.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13225857
      
      fbshipit-source-id: e963194a8c14046e7884abb4bcb265442b6978f7
      8c7e748d
  3. 27 Nov, 2018 9 commits
    • Kirk Shoop's avatar
      change abort to terminate · 77e5e1b5
      Kirk Shoop authored
      Summary: search replace abort with terminate to fix build errors
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13106734
      
      fbshipit-source-id: 146367a7fdbed9c945cb32cfdcb5ac521a1c861b
      77e5e1b5
    • Abhay Bothra's avatar
      FunctionScheduler: Fix typo in comment · f3260585
      Abhay Bothra authored
      Summary: Fixes minor typo and word re-ordering in comment
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13122529
      
      fbshipit-source-id: b713099dc06be8fdd525ba9d9e2fafd5511bd7f1
      f3260585
    • David Rothera's avatar
      Define macro for disabling thread and address sanitizer and use on range SSE methods · 7b82832d
      David Rothera authored
      Summary: [folly] Define macro for disabling thread sanitizer and use on range SSE methods
      
      Reviewed By: yfeldblum, pixelb
      
      Differential Revision: D13192417
      
      fbshipit-source-id: 23774f8e0227c4c557d51f557b4df5e79f641386
      7b82832d
    • Yedidya Feldblum's avatar
      Use static constexpr WaitOptions in UnboundedQueue · 79c28f03
      Yedidya Feldblum authored
      Summary: [Folly] Use `static constexpr WaitOptions` in `UnboundedQueue` to save one store-word-to-stack instruction in the inlined fast path with gcc.
      
      Reviewed By: magedm
      
      Differential Revision: D13187890
      
      fbshipit-source-id: 79a4f4ba585ed8abaebef344081bd364144f6cf8
      79c28f03
    • Yedidya Feldblum's avatar
      Some functions to look at UnboundedQueue inlined code · 875819ab
      Yedidya Feldblum authored
      Summary: [Folly] Some functions to look at `UnboundedQueue` inlined native code. Doing everything runs into the combinatorial explosion wall, but do USPSC and UMPMC dequeue variants.
      
      Reviewed By: magedm
      
      Differential Revision: D13187510
      
      fbshipit-source-id: 676e00c770682d44a87d0f8d81b050629bc05820
      875819ab
    • Yedidya Feldblum's avatar
      UnboundedQueue::dequeue overload returning value type · 31c7bffd
      Yedidya Feldblum authored
      Summary:
      [Folly] `UnboundedQueue::dequeue` overload returning value type.
      
      For completeness.
      
      Reviewed By: magedm
      
      Differential Revision: D13176745
      
      fbshipit-source-id: 9ab7ee36539924b2f9dbd401ec4730151ebf712b
      31c7bffd
    • Yedidya Feldblum's avatar
      More constexpr in WaitOptions · 9a0d63ca
      Yedidya Feldblum authored
      Summary: [Folly] More `constexpr` in `WaitOptions`.
      
      Reviewed By: magedm
      
      Differential Revision: D13176175
      
      fbshipit-source-id: 34f5300be29ba5903c9d9d2fb630d9f34ea094ac
      9a0d63ca
    • Andrew Gallagher's avatar
      folly/Preprocessor.h: fix `FB_ANONYMOUS_VARIABLE` in modular builds · d94318a5
      Andrew Gallagher authored
      Summary:
      Modular builds build each module with its own preprocessor state, meaning
      `__COUNTER__` no longer provides a unique number across a TU.  Instead of
      calling back to just `__LINE__`, use a mix of `__COUNTER__` and `__LINE__`
      to try provide as much uniqueness as possible.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13152221
      
      fbshipit-source-id: e1728d56f793d2f2cc7992056f6049c4c3566c94
      d94318a5
    • Krishna Kondaka's avatar
      folly::json does not increment lineNum_ when skipping whitespace · 6dbd476b
      Krishna Kondaka authored
      Summary:
      folly::json does not increment lineNum_ when skipping whitespace
      It shows wrong line number when reporting errors.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13038266
      
      fbshipit-source-id: b424690c50f039695458ec7a7b83816e64ab9c38
      6dbd476b
  4. 26 Nov, 2018 4 commits
    • Yedidya Feldblum's avatar
      Add std dev to UnboundedQueue bench for flavor · 83b6dc7a
      Yedidya Feldblum authored
      Summary: [Folly] Add std dev to `UnboundedQueue` bench for flavor.
      
      Reviewed By: magedm
      
      Differential Revision: D13192196
      
      fbshipit-source-id: c702c0c6b5a788d4f02e6b87220f8a63b55f22cc
      83b6dc7a
    • Yedidya Feldblum's avatar
      Avoid gtest expectations in UnboundedQueue benchmark · 147a597e
      Yedidya Feldblum authored
      Summary: [Folly] Avoid gtest expectations in `UnboundedQueue` benchmark; prefer `DCHECK` so assumptions may be validated without `NDEBUG` but so measurements may be taken with `NDEBUG`.
      
      Reviewed By: magedm
      
      Differential Revision: D13192005
      
      fbshipit-source-id: 133cf0b8ed0e924e5c9ad3e7b85035fa061ccc40
      147a597e
    • Yedidya Feldblum's avatar
      Avoid measuring thread::join in UnboundedQueue benchmark · 49838bbf
      Yedidya Feldblum authored
      Summary:
      [Folly] Avoid measuring `thread::join` in `UnboundedQueue` benchmark.
      
      Use a single `barrier` which also replaces the technique which avoids measuring thread start.
      
      Reviewed By: magedm
      
      Differential Revision: D13192004
      
      fbshipit-source-id: 9b86bed2efb110dc863994e1114b4e7c40f9f225
      49838bbf
    • Yedidya Feldblum's avatar
      No need to annotate SSE noasan decls · c892be25
      Yedidya Feldblum authored
      Summary: [Folly] No need to annotate SSE noasan decls - it's the defns which need annotation.
      
      Reviewed By: davidrothera
      
      Differential Revision: D13198964
      
      fbshipit-source-id: 97af85c6a593dcd4043b650f824b037f74092839
      c892be25
  5. 22 Nov, 2018 2 commits
    • Andrii Grynenko's avatar
      Fix ObserverManager::waitForAllUpdates() to not deadlock · 4c291582
      Andrii Grynenko authored
      Summary: Make sure waitForAllUpdates returns if there are no updates in flight.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13165909
      
      fbshipit-source-id: d48c1f3b7df451fed4aec54ab6d9c9cedb1d7470
      4c291582
    • Yedidya Feldblum's avatar
      Fix SharedPromise move-ctor, move-assign · 30af28c6
      Yedidya Feldblum authored
      Summary: [Folly] Fix `SharedPromise` move-ctor, move-assign. Some fields really should be zero'd.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D13152287
      
      fbshipit-source-id: 1ab2da8016cbd736541a98ff32f32c30f6452209
      30af28c6
  6. 21 Nov, 2018 7 commits
    • Adam Simpkins's avatar
      update the CMake files to set FOLLY_HAVE_PIPE2 · 5f5230ff
      Adam Simpkins authored
      Summary:
      Update the CMake build to define `FOLLY_HAVE_PIPE2` correctly.  This macro is
      used in folly/Subprocess.cpp but was not previously set by the CMake build
      files.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13151341
      
      fbshipit-source-id: 463e9ed0bad694397e33841441698029f186d30b
      5f5230ff
    • Adam Simpkins's avatar
      fix finding gflags in the CMake build (#957) · 57fa54ca
      Adam Simpkins authored
      Summary:
      This reverts D7505908 (github commit ad317726 / issue #805), which broke
      finding gflags through it's installed CMake configuration file.
      
      The comment from the original diff indicates that they thought this line was
      supposed to find folly's `CMake/FindGFlags.cmake` file.  However, this line is
      intended to find the `gflags-config.cmake` file installed by gflags.
      The `find_package(GFlags MODULE)` check several lines later will be used to
      find folly's `FindGFlags.cmake` module if no installed configuration file is
      found.
      
      The change in D7505908 caused the code to never use the cmake config file
      installed by gflags, due to the case mistmatch with the `gflags_FOUND` check
      on the line below.
      
      Closes https://github.com/facebook/folly/pull/957
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13151340
      
      fbshipit-source-id: 0c7234d264dd26ae028a0ae1155c9ddc3f04ea1e
      57fa54ca
    • Adam Simpkins's avatar
      remove PlatformConfig.h · 696338da
      Adam Simpkins authored
      Summary:
      Eliminate the custom PlatformConfig.h header that could be included by
      defining `FOLLY_PLATFORM_CONFIG` with a command line compiler flag.  This
      separate header was only used to control one setting (`FOLLY_HAVE_PIPE2`), and
      can easily be done in the normal `folly-config.h` header.
      
      Including this file with a compiler command-line macro made it not behave
      nicely when using clang modules.
      
      Reviewed By: andrewjcg, yfeldblum
      
      Differential Revision: D13151079
      
      fbshipit-source-id: ae3cc98b7494d409d87bc3e47d740d844c42a940
      696338da
    • Andrii Grynenko's avatar
      waitForAllUpdates() · ec519fc5
      Andrii Grynenko authored
      Summary: This is useful for unit tests which need to wait for observer updates.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13133404
      
      fbshipit-source-id: ff36f55ec537490a763865cea2125617b58dc9c0
      ec519fc5
    • Mark Santaniello's avatar
      Make folly::Range more permissive of incomplete types · 23020412
      Mark Santaniello authored
      Summary: Defer evaluation so that conversion operator value_type can be incomplete.
      
      Reviewed By: yfeldblum, nbronson
      
      Differential Revision: D13123972
      
      fbshipit-source-id: b53431232d20b2962530ad9ad81ed12acb5d7208
      23020412
    • Maged Michael's avatar
      ConcurrentHashMap: Temporarily disable using hazptr_obj_batch for bucket arrays. · 9a7456e6
      Maged Michael authored
      Summary:
      Completes the previous change to disable destruction order guarantee for keys and values to give some higher-level users of ConcurrentHashMap time to adapt to the destruction order guarantee.
      To reenable the destruction order guarantee, uncomment the two calls to set_batch_tag that were commented out in this and the previous change.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D13141742
      
      fbshipit-source-id: c49ad5b0a0f82da7b36e0fea294425ec2b681ab9
      9a7456e6
    • Yedidya Feldblum's avatar
      Implicitly default the SharedPromise ctors, assigns, dtor · b9e1c0ca
      Yedidya Feldblum authored
      Summary:
      [Folly] Implicitly default the `SharedPromise` ctors, assigns, dtor.
      
      If the default implementations are correct, then they are easier to maintain over time.
      
      Has the effect of removing thread-safety from the move-assign operator. Which is quite alright - copy-assignment and move-assignment operators being thread-safe is weird.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D13131063
      
      fbshipit-source-id: 2be67b06d2a65867dc8ebbd7364b74a9cd1c2a20
      b9e1c0ca
  7. 20 Nov, 2018 2 commits
    • Maged Michael's avatar
      ConcurrentHashMap: Temporarily disable destruction order guarantee. · 3c798d86
      Maged Michael authored
      Summary: Temporarily disable the use of hazptr_obj_batch until higher-level users adapt to the destruction order policy of completing the destruction of keys and values by the completion of ConcurrentHashMap destructor.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13136251
      
      fbshipit-source-id: ee2ed21d1825d2609d8f097e878457975d7909e8
      3c798d86
    • Lee Howes's avatar
      A range of cleanup then to thenValue fixes pending explicit deletion · 4ec869b9
      Lee Howes authored
      Summary: Future::then taking a value-taking function is deprecated and being deleted. This cleans up a few more callsites.
      
      Reviewed By: yfeldblum, Orvid
      
      Differential Revision: D13116186
      
      fbshipit-source-id: 9586029a4fa70b438e6cf09861842a5b585da2c5
      4ec869b9
  8. 19 Nov, 2018 2 commits
    • Orvid King's avatar
      AsyncServerSocket::ConnectionEventCallback to NetworkSocket · 50a21b1b
      Orvid King authored
      Summary: Just do this atomically as there's only 2 places that use this.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13104245
      
      fbshipit-source-id: ca3c5271deaade071e5e497bde5eeb15d5513e59
      50a21b1b
    • Maged Michael's avatar
      ConcurrentHashMap: Use hazptr_obj_batch. · 6100907a
      Maged Michael authored
      Summary: Use hazptr_batch and tagged objects for buckets and nodes. After this diff, higher-level users no longer need to call hazptr_cleanup. CHM destructor guarantees the destruction of all key and value objects that were in this instance of CHM.
      
      Reviewed By: djwatson
      
      Differential Revision: D10150474
      
      fbshipit-source-id: 99530971d157ce4ca0bb0a983b3f7eb40666885e
      6100907a
  9. 18 Nov, 2018 6 commits
    • Yedidya Feldblum's avatar
      Remove unused template param defaults in LockFreeRingBuffer · d4b4982c
      Yedidya Feldblum authored
      Summary: [Folly] Remove unused template param defaults in `LockFreeRingBuffer`.
      
      Differential Revision: D13113827
      
      fbshipit-source-id: 9400853cde60b8bc227383b2a0ab1efb95786d87
      d4b4982c
    • Yedidya Feldblum's avatar
      Defer all initialization until allocation in IndexedMemPool · 385b4994
      Yedidya Feldblum authored
      Summary: [Folly] Defer all initialization until allocation in `IndexedMemPool`. This provides a better guarantee that the constructor never dirties the allocated region by accidentally direct-initializing rather than default-initializing the linked list pointers in the mapped region.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D13046558
      
      fbshipit-source-id: 1bde547525e2502607d01e68206d7f8c826baebd
      385b4994
    • Lee Howes's avatar
      Remove dependncy on value-taking form of then from folly · 3222b57b
      Lee Howes authored
      Summary: Remove uses of folly::Future::then(task-taking-value) from folly and replace with thenValue.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13115197
      
      fbshipit-source-id: 3843ec2412a0dfc0c2ee7940ff7e17320215ff72
      3222b57b
    • Yedidya Feldblum's avatar
      invoke_cold, catch_exception · 6ec1462b
      Yedidya Feldblum authored
      Summary: [Folly] `invoke_cold`, `catch_exception`. These may be used to facilitate preprocessor-free-at-call-site `try`-and-`catch` in library code when compiling with `-fno-exceptions`.
      
      Reviewed By: swolchok
      
      Differential Revision: D13020421
      
      fbshipit-source-id: d9d7998e00eed6ced943ea73b648fa0b7cabd831
      6ec1462b
    • Aaryaman Sagar's avatar
      Remove inline asm from PicoSpinLock · 95934611
      Aaryaman Sagar authored
      Summary:
      Removes the inline asm from PicoSpinLock and uses the fetch_set and
      fetch_reset utilities instead
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9697136
      
      fbshipit-source-id: 022bb2d2d9d7cd6ac8a0011bff4c8995db989950
      95934611
    • Orvid King's avatar
      Remove the file descriptor overload of shutdownNoInt · f98c3cdc
      Orvid King authored
      Summary: It's no longer needed
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13105079
      
      fbshipit-source-id: d9d1ea7cc11380ea0d17cfee6055e113b888e465
      f98c3cdc
  10. 17 Nov, 2018 4 commits