- 09 Dec, 2016 1 commit
- 
- 
Qinfan Wu authoredSummary: It deletes things even when input isn't in the container. Reviewed By: luciang Differential Revision: D4298340 fbshipit-source-id: 3e8fc04c2c21eb231dcaf82239ac5f6d25e49e2c 
 
- 
- 07 Dec, 2016 9 commits
- 
- 
David Lam authoredSummary: `condition_variable::wait_for` takes as second param `std::chrono::duration` and not a predicate; what we want is `condition_variable::wait`. Reviewed By: simpkins Differential Revision: D4295305 fbshipit-source-id: 05f735fe6e7ecb9d8f42cb38a2985b9ce9dad984 
- 
Christopher Dykes authoredSummary: MSVC has the ability to warn about implicit truncations and places where implicit sign coercions are occuring, so do some cleanup to make it possible to compile with the warnings enabled. Reviewed By: yfeldblum Differential Revision: D4288028 fbshipit-source-id: f8330c62b2dcb76f696dfc47888f0e3e1eefc21a 
- 
Yedidya Feldblum authoredSummary: [Folly] Cut some includes from `Executor.h`. Reviewed By: mzlee Differential Revision: D4256618 fbshipit-source-id: 1728f48b3c0ec4e0c4c84c44bd8afb583d438129 
- 
Wez Furlong authoredSummary: Nothing defines USE_JEMALLOC in the OSS build today and that causes some portability problems. Specifically, the homebrew recipe will make libjemalloc available and our configure script will detect it and add it to the library flags. Our subsequent check for `malloc_usable_size` then finds this function in libjemalloc. When later attempting to build wangle against the homebrew folly we get compilation failures because the prototype for `malloc_usable_size` is only available in the jemalloc headers and nothing in the saved configuration for folly is set up for this to be pulled in as it it guarded by `USE_JEMALLOC`. This attempts to resolve the situation by forcing on `USE_JEMALLOC` when we detect the library in configure. This is made a little more complicated because we cannot set `USE_JEMALLOC` in the OSS build; it gets rewritten to have a `FOLLY_` prefix. Since we have code outside of folly that requires that this symbol be `USE_JEMALLOC`, I've changed the conditional to check for both flavors of the symbol, with and without the prefix. Reviewed By: yfeldblum Differential Revision: D4289176 fbshipit-source-id: 756bc815c3ef1fac454e603feb72155d98c5aadd 
- 
Eric Niebler authoredSummary: Inspired by http://wg21.link/p0259, folly::BasicFixedString is a std::string replacement that is usable in constexpr contexts. It uses an internal fixed-size buffer to store up to N characters, where N is a template parameter. Reviewed By: luciang Differential Revision: D4249529 fbshipit-source-id: 10f12ea2510a8d21ec60a07a8f15ecc3e35c5431 
- 
Christopher Dykes authoredSummary: `stdin`, `stdout` and `stderr` are macros that expand to function calls with the MSVC CRT implementation. This is also the case for musl-libc. This means that Subprocess simply cannot be compiled on those platforms without changing the API. To solve that, we change the API and deprecate the old API. For more fun, `stdin`, `stdout` and `stderr` are also macros in glibc, they just expand to other identifiers rather than a function call. Reviewed By: yfeldblum Differential Revision: D4229544 fbshipit-source-id: 97f1a3b228b83cfdcaffee56d729063ea235e608 
- 
Nathan Bronson authoredSummary: Fix use-after-destroy of NewThreadExecutor. Detected by opt-ubsan tests. Reviewed By: yfeldblum Differential Revision: D4291900 fbshipit-source-id: 206f1d7b80fa04e1570e4b7a20e50b9a8ceb7bcb 
- 
Nathan Bronson authoredSummary: Freshly opened TCP sockets can have a send buffer size bigger than wmem_default, because connection parameters are cached in the route cache. Some of the async socket tests assumed that writing 8M of data was enough to guarantee blocking behavior, but since wmem_max is 20M on our systems the resulting tests are flaky. Reviewed By: marcinpe Differential Revision: D4292201 fbshipit-source-id: ba5d606d080330e455eee2b17bcae6cf546bf981 
- 
Dan Schatzberg authoredSummary: Add the default move constructor and move operator to EvictingCacheMap so it can be moved. Reviewed By: markisaa, luciang Differential Revision: D4287472 fbshipit-source-id: 130e9d5467d6da14ba95a9e769cf8e8d541a704c 
 
- 
- 06 Dec, 2016 5 commits
- 
- 
Andrii Grynenko authoredSummary: UBSAN instrumentation results in more stack being used. Applying the same logic we already have for ASAN there. Reviewed By: igorsugak Differential Revision: D4287455 fbshipit-source-id: 1a224cb5a3654c23b15fa298bf80476234a1418c 
- 
Michael Lee authoredSummary: MacAddress only needs to include ostream and the test header does not need iostream. Differential Revision: D4286405 fbshipit-source-id: e64fdd4e8428c62279ed7c185188f3dfc14096d3 
- 
Michael Lee authoredSummary: We do not need it and it adds a static initialization This is the last extra one in liger. The other places actually need iostream to print things Reviewed By: yfeldblum Differential Revision: D4286095 fbshipit-source-id: 44a827e48e9fb9106626e784592eb194dff83bf6 
- 
Christopher Dykes authoredSummary: The benchmark API only supports `unsigned int` as the iteration number, so this being 64-bit means it has to be truncated for no reason. This change gets us closer to being able to enable MSVC's implicit truncation warnings. Reviewed By: yfeldblum Differential Revision: D4281264 fbshipit-source-id: 27397e3f23bace20f3cc457665ea6f21bf994da5 
- 
Misha Shneerson authoredSummary: I was getting an error when running commands in https://our.intern.facebook.com/intern/dex/fibers/gdb/ Reviewed By: andriigrynenko Differential Revision: D4283229 fbshipit-source-id: fe45847d0ec6cadfbce6fe9818066cce3e275a46 
 
- 
- 05 Dec, 2016 2 commits
- 
- 
Eric Niebler authoredSummary: overload constexpr_strlen to work with other character types Reviewed By: yfeldblum, luciang, Orvid, ot Differential Revision: D4269654 fbshipit-source-id: 2fcd666669efb51d77e847ff31bda3a301e763da 
- 
Eric Niebler authoredReformulate constexpr_min and constexpr_max to achieve stability in sorting as described in http://stepanovpapers.com/notes.pdf Summary: There is a famous long-standing "bug" in the standard library regarding the semantics of min and max wrt values that are equivalent wrt op< but not equal. Let's not make the same mistake with constexpr_min and constexpr_max. Reviewed By: yfeldblum, luciang, Orvid, ot Differential Revision: D4269635 fbshipit-source-id: 19b464c949dc0cf07afb08eaf657ae8b242ca42d 
 
- 
- 04 Dec, 2016 1 commit
- 
- 
Amir Shalem authoredSummary: Fix potential double close() on exception when SO_REUSEPORT fails. The fd will be closed twice, once by close() and second by the scope guard above. Reviewed By: yfeldblum Differential Revision: D4272300 fbshipit-source-id: a163be822d7522cadb9dc3c3eddca10df453de14 
 
- 
- 03 Dec, 2016 1 commit
- 
- 
Christopher Dykes authoredSummary: MSVC was getting thoroughly confused while trying to eval the constexpr function, so switch it to a template instead. MSVC was also failing to wrap it's head around what a NodeRecycler is, so delay its resolution via typename. Reviewed By: yfeldblum Differential Revision: D3478755 fbshipit-source-id: f687f4538fb12ef8eee525557f4cc988a09e714d 
 
- 
- 02 Dec, 2016 2 commits
- 
- 
Christopher Dykes authoredSummary: This makes the changes required to allow folly to compile cleanly with the sign/unsigned mismatch warnings 4388 and 4389, as well as with warnings 4804 and 4805, which are about comparisons between scalars and bool. Most of the changes in this are to `DCHECK_*` calls which are translated to a templated call which does the comparison internally based on the inferred type of the argument, which for a literal `0` is `int`, causing the warnings to get generated when the comparison is done. Reviewed By: yfeldblum Differential Revision: D4253427 fbshipit-source-id: cd17973a78e948a62c886a2959f9abf40a69f9f5 
- 
Scott Michelson authoredSummary: This brings the EventBase functionality of getting a timer for the eventbase into the virtual interface Differential Revision: D4264135 fbshipit-source-id: e5526610eca808e1d7b549a7cd6cd7b2c65d3ce1 
 
- 
- 01 Dec, 2016 5 commits
- 
- 
Adam Simpkins authoredSummary: Add a utility function to more safely set a file's contents by writing to a temporary file first, then renaming the temporary file into place. On Linux systems where renames are atomic, this ensures that the operation either succeeds or that the old file state is left unchanged on failure. Note that unlike most of the other APIs in FileUtil.h, I intentionally made writeFileAtomic() throw an exception on failure. This is implemented using a lower-level writeFileAtomicNoThrow() version. Callers who care about the exception overhead can use the lower level version instead. (Exception overhead should be relatively low compared to the file I/O operations, though, so I suspect most users will prefer the throwing APIs.) Reviewed By: yfeldblum Differential Revision: D4253964 fbshipit-source-id: 5301e2791b82c6f90b63bb509b0411841c266705 
- 
Yedidya Feldblum authoredSummary: [Folly] `Future<typename>::getTryVia`. We have `waitVia` and `getVia` and `getTry`, but `getTryVia` was missing. Reviewed By: fugalh Differential Revision: D4254972 fbshipit-source-id: 403e1a3496ad5dfc93c4c55ab75a83bcc89e6c64 
- 
Subodh Iyengar authoredSummary: Fix test for AsyncSSLSocket. When a timeout occurs during a handshake it's possible that invokeConnectError is called with sslState_ == CONNECTING. This just removes the assertion in this case. This doesnt affect prod code, only tests Reviewed By: yfeldblum Differential Revision: D4252677 fbshipit-source-id: 4db3a94ae28aa140546554c087bedcee7f06d201 
- 
Andrii Grynenko authoredSummary: Switching ServiceRouter code to use VirtualEventBase instead of EventBase allows us to have same thread-pool shared between multiple ServiceRouter instances. In future this allows us to replace EventBasePoolImpl with some generic thread-pool implementation (e.g. IOThreadPoolExecutor). It also makes it trivial to have ServiceRouter run on a any existing thread-pool if necessary. Reviewed By: smichelson Differential Revision: D3935283 fbshipit-source-id: 3275bbace15a0df8b06d12c970ccc098a631658d 
- 
Andrii Grynenko authoredSummary: folly::SingletonThreadLocal should be used for all thread-local singletons to avoid SDOF. Reviewed By: yfeldblum Differential Revision: D4253009 fbshipit-source-id: 5b4ca57a7a77b7b54c94630a2a29d13b84a3af27 
 
- 
- 30 Nov, 2016 3 commits
- 
- 
Christopher Dykes authoredSummary: Truncations should be explicit, but for some reason, MSVC seems to be the only compiler that will warn you when you implicitly truncate integer or float values. This allows Folly to be compiled with warnings 4018, 4242, 4244 and 4305 enabled. Technically 4018 is a sign mismatch warning, but there was only one place it was being triggered so I included it anyways. The other 3 are warnings for implicit truncation. There is one other implicit truncation warning that currently triggers in Folly, 4267, but there are a lot more places where that triggers so I'll do that in a separate diff. Reviewed By: yfeldblum Differential Revision: D4249471 fbshipit-source-id: e18a93d85856c998576934a6229c9edd1638a54e 
- 
Teng Qin authoredSummary: Using newly added `StaticTracepoint.h`, add a Tracepoint for `RequestContext` switch that could be enabled by compiler flag. Reviewed By: drarmstr Differential Revision: D4238658 fbshipit-source-id: 043a035ba8251b48d7b29d63a2219ad2edda164f 
- 
Eric Niebler authoredSummary: More constexpr is better! Reviewed By: yfeldblum, luciang, ot Differential Revision: D4244996 fbshipit-source-id: 30a9b726c115a92bb18538d7f18e50eccb0a1ef6 
 
- 
- 29 Nov, 2016 5 commits
- 
- 
Tiho Tarnavski authoredSummary: If a write request is buffered after a partial write, then bytes written is not updated after subsequent write operations (`performWrite`) for the buffered write request (`BytesWriteRequest`). This results in a wrong value for totalBytesWritten_, which is reported in the error callback in case the write request fails. Reviewed By: yfeldblum Differential Revision: D4205743 fbshipit-source-id: f77ca55ccfdceda1008c45e72ec093b00bf250e4 
- 
Andrii Grynenko authoredSummary: Make folly::Singleton fail if singleton is requested before registrationComplete. By doing this we disallow any folly::Singleton to be created before main(). Strict mode is still disabled for Python and Hs. Reviewed By: yfeldblum Differential Revision: D4121322 fbshipit-source-id: b66c23e24f6a7324cd12ddb77cad960e0950a1aa 
- 
Guo Xiao authoredSummary: Closes https://github.com/facebook/folly/pull/520 Reviewed By: pixelb Differential Revision: D4243347 Pulled By: yfeldblum fbshipit-source-id: cae0b36abdc7807afc188220f7f421f2a3bbc973 
- 
Nick Terrell authoredSummary: D4194834 broke the OSS build. Ubuntu 14.4 has r114 in its repo, so support it. Reviewed By: yfeldblum Differential Revision: D4224129 fbshipit-source-id: c85e95716ee1a08b33455bfe6fc9f7712d226edf 
- 
Christopher Dykes authoredSummary: Because MSVC isn't happy about it and generates a warning with a lot of context. Reviewed By: yfeldblum Differential Revision: D4242688 fbshipit-source-id: b1e26c9e3b58e7bac0e00ab8959358010fa610e8 
 
- 
- 28 Nov, 2016 2 commits
- 
- 
r8k authoredSummary: * include all dependencies * update `autoconf` & `configure` with correct params * include `make` & `make install` in the bootstrap for a better user experience * fixes #332 Closes https://github.com/facebook/folly/pull/513 Reviewed By: yfeldblum Differential Revision: D4177362 Pulled By: Orvid fbshipit-source-id: c62d6633c382fca57bb06db08724a7355b71bdb3 
- 
Yedidya Feldblum authoredSummary: [Folly] Canonicalize some aspects of the `folly/experimental/hazptr` test. * Remove the custom `main()` and use the provided weak symbol, either from `folly/test/common/TestMain.cpp` or from `gtest` depending on the build. * Extract some common setup/teardown (just debug logging in this case) to a test fixture. Reviewed By: Orvid Differential Revision: D4234154 fbshipit-source-id: 25613cba0ad6c9147714d98150e013fba1a64d46 
 
- 
- 27 Nov, 2016 1 commit
- 
- 
Phil Willoughby authoredSummary: Thanks nbronson for suggesting this fix. I don't see why this should make any difference (and nor does clang) but the important thing is that it works now. Reviewed By: nbronson Differential Revision: D4212670 fbshipit-source-id: 08b4313d736f237039a807fbc458d4d581a2ef35 
 
- 
- 25 Nov, 2016 3 commits
- 
- 
Christopher Dykes authoredSummary: Otherwise it won't work under MSVC where we don't have Futexes. This is achieved by using the Futex API already used elsewhere in Folly. Reviewed By: yfeldblum Differential Revision: D4233517 fbshipit-source-id: d6ae6a34b2287cf485f8e4a316445a2ba746d1a7 
- 
Christopher Dykes authoredSummary: This reverts commit 636ed5ae8ad36a323054efaad96d3756f1b7b9d0 Differential Revision: D4214296 fbshipit-source-id: 41fe55a8fcbf41cce44fee7ba65eda5aadbf97b3 
- 
Subodh Iyengar authoredSummary: When TFO falls back, it's possible that the fallback can also error out. We handle this correctly in AsyncSocket, however because AsyncSSLSocket is so inter-twined with AsyncSocket, we missed the case of error as well. This changes it so that a connect error on fallback will cause a handshake error Differential Revision: D4226477 fbshipit-source-id: c6e845e4a907bfef1e6ad1b4118db47184d047e0 
 
- 
