1. 21 Nov, 2018 5 commits
    • 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
  2. 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
  3. 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
  4. 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
  5. 17 Nov, 2018 12 commits
  6. 16 Nov, 2018 3 commits
  7. 15 Nov, 2018 5 commits
  8. 14 Nov, 2018 5 commits
    • Maged Michael's avatar
      hazptr: Batches and tags for managing destruction order. · b2df58ec
      Maged Michael authored
      Summary:
      Add batches and tags for objects protectable by hazard pointers.
      Add fine-grained cleanup of tagged objects (lower overhead than calling hazptr_cleanup).
      
      Design sketch:
      - The domain structure contains an untagged list and one or more tagged lists (more than one to reduce contention).
      - These domain lists support lock-free push and lock-free unlocked pop all. Tagged lists are locked by pop all operations and unlocked by push_unlock operations. Push operations are  lock-free even when a list is locked for pop all operations.
      - Batches are lists of retired objects.
      - Each object contains the address of a batch (or null). The lowest bit indicates if the batch address is used also as a tag.
      - hazptr_cleanup_batch_tag(tag) reclaims all objects with that tag without checking hazard pointers.
      - All objects in a domain tagged list contain tagged objects that hash to the index of the list.
      - Untagged object are those that are safe to reclaim at shutdown time, i.e., their deleter only reclaims memory without other dependencies.
      - For example, retired UnboundedQueue segments do not depend on user-defined destructors and their deleters merely reclaim memory using the default deleter, and therefore can be untagged.
      - On the other hand, the deleters of ConcurrentHashMap buckets and nodes depend on user-defined code and therefore their destruction must be managed explicitly. Therefore they are tagged.
      - Batches can be used even without tagging. For example retired UnboundedQueue segments are collected in batches because they have link-counting interdependencies and batches help keep related segments together.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D10147101
      
      fbshipit-source-id: 8820cf46ad8942c7362d91543bfbd9fe07e27b7a
      b2df58ec
    • Mingtao Yang's avatar
      SSLContext::loadCertificateFromBufferPEM should load entire chain · 77f06ada
      Mingtao Yang authored
      Summary:
      SSLContext::loadCertificate() loads a certificate chain with SSL_CTX_use_certificate_chain_file.
      
      A method named SSLContext::loadCertificateFromBufferPEM() should have the same semantics.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13037752
      
      fbshipit-source-id: da7b150065d2207421c6bba86d44ce5e2c57e1a9
      77f06ada
    • Lee Howes's avatar
      Split folly::futures::map over value and Try forms · df642f04
      Lee Howes authored
      Summary: Splits folly::futures::map over forms that take value continuations and try continuations. This allows the implementation to call Future::thenValue and Future::thenTry correctly.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D10861465
      
      fbshipit-source-id: 31044127f43e574edcc01c6bb173ecc4f0c9c90e
      df642f04
    • Yiding Jia's avatar
      Fix folly/Range.h with c++17 and libc++ again · 90ae95ed
      Yiding Jia authored
      Summary:
      Avoid create StringViewType if value_type is not POD, as with libc++ there is a
      static_assert in the class body which seems to fail.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D13015696
      
      fbshipit-source-id: 090e5cd3f5e21aa8c22ea893e894b38fd3d2a745
      90ae95ed
    • Andrew Gallagher's avatar
      folly/executors: fix extraneous semi-colon · faa7f7fb
      Andrew Gallagher authored
      Reviewed By: yfeldblum
      
      Differential Revision: D13056552
      
      fbshipit-source-id: 910296cda7d392972a48c8fa3e425b4bdeaa5d26
      faa7f7fb