- 30 Nov, 2018 4 commits
-
-
Subodh Iyengar authored
Summary: A default value of true for SO_REUSEADDR is dangerous. SO_REUSEADDR has several issues. For example if SO_REUSEADDR is used to bind to a socket which is already bound but not connected, the kernel will allow this operation to complete. This can cause overlapping data. https://www.spinics.net/lists/netdev/msg206437.html Looking at use cases of AsyncUDPSocket it does not look like people depend on this behavior of AsyncUDPSocket and this was first introduced in thrift for no reason. This changes the behavior back to false. Reviewed By: yfeldblum, djwatson Differential Revision: D13274704 fbshipit-source-id: 391cf1bdd3f633bee38c230fcd9f1403ea950c3b
-
Nathan Bronson authored
Summary: It's easy to accidentally rely on the relationship between insert and iteration order in unordered containers. This diff adds some randomization to the insertion order within an F14 chunk when compiled in debug mode. This isn't full randomization of the order, but is enough to break tests that rely on the iteration order of F14 maps and sets as small as two elements. This diff applies randomization to folly::dynamic object, F14NodeSet, F14NodeMap, F14ValueSet, F14ValueMap, F14FastSet for small (< 24 bytes) value_type, and F14FastSet for small value_type. The long-term plan is to randomize insertion order for all F14FastSet and F14FastMap, leaving iteration order deterministic only for explicit uses of F14VectorSet and F14VectorMap. Reviewed By: yfeldblum Differential Revision: D13099681 fbshipit-source-id: 35b3174a8afbc6cef27d2080adc5a01e85154dcd
-
Doron Roberts-Kedes authored
Summary: Mimic the atomic history buffers in relacy. This diff allows older values for atomics to be returned as long as the memory model is respected. Enforce the memory model with vector clocks (ThreadTimestamps). Depends on D10418223 Reviewed By: djwatson Differential Revision: D10418450 fbshipit-source-id: 0556259e96d512030ff9924bbd5aa0f79a38dfff
-
Nathan Bronson authored
Summary: In most cases two implicit conversions can be chained to perform an explicit construction, but that is not the case when the intermediate type has a template parameter that can't be deduced. This interferes with heterogeneous lookup when the transparent hasher or equality functor work by implicit conversion to a base type (like folly::Range). This diff disables heteregeneous find in cases where the hash functor or equality functor are not invocable. Reviewed By: yfeldblum Differential Revision: D13264397 fbshipit-source-id: 082c3215e81ab58f3fa9519da872642e45b16245
-
- 29 Nov, 2018 10 commits
-
-
Scott Wolchok authored
Summary: No need for String to import fbvector. Reviewed By: yfeldblum Differential Revision: D13007715 fbshipit-source-id: c61639a04273f14dd3daf230ee6ed9ade93d058e
-
Nathan Bronson authored
Summary: This diff fixes a few rough edges in the folly::sorted_vector_set and folly::sorted_vector_map APIs. It makes the default constructor implicit; it adds emplace to sorted_vector_set; and it adds bulk insertion via std::initializer_list to sorted_vector_set and sorted_vector_map. This doesn't fix all incompatibilities. It also changes sorted_vector_set and sorted_vector_map insertion so that they do not copy a value_type const& argument if the key is already in the container. Reviewed By: yfeldblum Differential Revision: D13255279 fbshipit-source-id: dc5a16ea729e2a32a77f82ec0eacaeaf7854cd1a
-
Andrii Grynenko authored
Summary: onError destroys the Core, which holds a Executor::KeepAlive, so we have to capture it before calling onError. Differential Revision: D13250857 fbshipit-source-id: 5f458765f0b8ccb225502c26413ff7bfdd46fe15
-
Nathan Bronson authored
Summary: Add static casts near memcpy to silence a compiler warning for a memcpy call site whose control flow is correctly guarded by the appropriate type_traits check. Reviewed By: yfeldblum, shixiao Differential Revision: D13241617 fbshipit-source-id: 747b6cd1bb32c0971e805d1a4a9cdc5da6c73ea9
-
Yedidya Feldblum authored
Summary: [Folly] Extract `getSingletonStackTrace` to its own detail library. For now, just do conditional definition, avoiding the atomic and the global constructor. Reviewed By: andriigrynenko Differential Revision: D13213446 fbshipit-source-id: 95af5701d1c29e0ef24ba48e9bcec9ec565b31b4
-
Yedidya Feldblum authored
Summary: [Folly] Let `SingletonThreadLocal` creator return derived type. This is a different interface for the creator type, and means supporting non-moveable/non-copyable types with an extra pointer indirection pre-C++17. Reviewed By: andriigrynenko Differential Revision: D13165769 fbshipit-source-id: 39f2b5fed48342dd3178a20838af50c43aabee86
-
Yedidya Feldblum authored
Summary: [Folly] Let `createGlobal` return a reference rather than a pointer, since it always returns non-`nullptr`. Reviewed By: andriigrynenko Differential Revision: D13116591 fbshipit-source-id: 5618c2e8a5a04b158ac45a3e43b02eb37c6af8c1
-
Yedidya Feldblum authored
Summary: [Folly] A small inline fast path for `StaticSingletonManager::create`. Reviewed By: andriigrynenko Differential Revision: D13114824 fbshipit-source-id: b72b6066b7ff5401e37e75aa1c8102e6536e9740
-
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
-
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
-
- 28 Nov, 2018 2 commits
-
-
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
-
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
-
- 27 Nov, 2018 9 commits
-
-
Kirk Shoop authored
Summary: search replace abort with terminate to fix build errors Reviewed By: yfeldblum Differential Revision: D13106734 fbshipit-source-id: 146367a7fdbed9c945cb32cfdcb5ac521a1c861b
-
Abhay Bothra authored
Summary: Fixes minor typo and word re-ordering in comment Reviewed By: yfeldblum Differential Revision: D13122529 fbshipit-source-id: b713099dc06be8fdd525ba9d9e2fafd5511bd7f1
-
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
-
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
-
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
-
Yedidya Feldblum authored
Summary: [Folly] `UnboundedQueue::dequeue` overload returning value type. For completeness. Reviewed By: magedm Differential Revision: D13176745 fbshipit-source-id: 9ab7ee36539924b2f9dbd401ec4730151ebf712b
-
Yedidya Feldblum authored
Summary: [Folly] More `constexpr` in `WaitOptions`. Reviewed By: magedm Differential Revision: D13176175 fbshipit-source-id: 34f5300be29ba5903c9d9d2fb630d9f34ea094ac
-
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
-
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
-
- 26 Nov, 2018 4 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Add std dev to `UnboundedQueue` bench for flavor. Reviewed By: magedm Differential Revision: D13192196 fbshipit-source-id: c702c0c6b5a788d4f02e6b87220f8a63b55f22cc
-
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
-
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
-
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
-
- 22 Nov, 2018 2 commits
-
-
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
-
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
-
- 21 Nov, 2018 7 commits
-
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
- 20 Nov, 2018 2 commits
-
-
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
-
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
-