- 27 Feb, 2017 2 commits
-
-
Christopher Dykes authored
Summary: This is the only place `inttypes.h` is used in Folly and it's used in a context where `cstdint` would have sufficed. Reviewed By: yfeldblum Differential Revision: D4619248 fbshipit-source-id: e67dccb7d8bf1ad5f7539d4b039590253e8d8c79
-
Christopher Dykes authored
Summary: These are the only includes of `sched.h` in Folly, and they really are unused: Reviewed By: yfeldblum Differential Revision: D4615501 fbshipit-source-id: 6a3a1aad7a91a92a322fd93d18e1284aa3f86b89
-
- 26 Feb, 2017 2 commits
-
-
Philip Pronin authored
Summary: It currently takes ~32kB of stack trace to run symbolizer, which is very close to ASan alt stack size (32 kB). If we exclude `demangle` (which can use unbound stack size in extreme cases), the heaviest path in symbolizer includes `FrameArray<100>` and three arrays of `PATH_MAX` (4 kB) size. This diff removes the former and one of the latters, reducing this code path from 32 kB to ~10 kB. Reviewed By: ot, yfeldblum Differential Revision: D4618467 fbshipit-source-id: e6a53b61b3d5f6e8b892216d2e9b839ed8430d0e
-
Christopher Dykes authored
Summary: It was only needed for GCC 4.7 support. GCC 4.8 and above support it. Reviewed By: yfeldblum Differential Revision: D4616044 fbshipit-source-id: 177d7b3b7090134f9d8084a3ba7a984446c87d5e
-
- 25 Feb, 2017 1 commit
-
-
Michael Lee authored
Summary: `last` was already passed in as a variable, so switch this so there isn't a local variable at all. Reviewed By: mlogan, yfeldblum Differential Revision: D4615206 fbshipit-source-id: dd8e3157e54dc2abe3dfd97837ce327371f4f7b2
-
- 24 Feb, 2017 2 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Drop support for gcc 4.7 with byteswap shim Reviewed By: igorsugak, Orvid Differential Revision: D4610746 fbshipit-source-id: 092cd432c7bda9ca5507d0230b6fcaa43b96c500
-
Giuseppe Ottaviano authored
Summary: `previousValue` makes the incorrect assumption that `outer_` is a multiple of the word size. This is incorrect because `skipToNext` can reposition at an arbitrary point. The bug is very rare because it can only happen if there is a gap larger than the skip quantum after the first element in the upper bits. Reviewed By: philippv Differential Revision: D4607270 fbshipit-source-id: ff016f09f3f1f87314b68370e3dc137b82694f45
-
- 23 Feb, 2017 1 commit
-
-
Mark Logan authored
Summary: antonl noticed that bulk_insert doesn't remove duplicates. We now run a std::unique() pass after merging. Reviewed By: yfeldblum Differential Revision: D4595304 fbshipit-source-id: 538364150aeea64b95488da158c09e07a6597e7c
-
- 21 Feb, 2017 1 commit
-
-
Michael Lee authored
Summary: `getCommonName` and `getSubjectAltName` are useful shared utility functions. Reviewed By: anirudhvr Differential Revision: D4546866 fbshipit-source-id: bcefc1ff3a02df93fbf0cd2d4f24569928bd1753
-
- 20 Feb, 2017 1 commit
-
-
Mark Williams authored
Summary: dbg and dbgo builds of hhvm with gcc-5 crash when generating backtraces using folly::Symbolizer, because the .debug_aranges for libc-2.23.so are SHF_COMPRESSED, and folly::Symbolizer doesn't recognize that. Just pretend that the section doesn't exist if it has SHF_COMPRESSED set. We might eventually want to support decompressing such sections under an option - but folly::Symbolizer's goal is to just mmap and walk the debug info without allocating memory (so that it can run while handling signals etc). Reviewed By: pixelb Differential Revision: D4586762 fbshipit-source-id: bef61ed670d1a80caa4f7aac1f80fd2a92cc4ba9
-
- 17 Feb, 2017 2 commits
-
-
Maged Michael authored
Summary: Added two variants of Baton by adding two Boolean template parameters with defaults that correspond to the original single poster blocking waiter version: - SinglePoster (single poster vs multiple posters). Default true. - Blocking (vs spinning). Default true. The multi-poster baton (SinglePoster = false) can be handed over by multiple concurrent posters, where redundant post()-s are idempotent but if a post() arrives after the baton is reset() then it unblocks the waiter. The nonblocking Baton (Blocking = false) has faster common case post(), by avoiding CAS in the critical path. It does so by disallowing waiter blocking and timed_wait(). Reviewed By: nbronson Differential Revision: D4506728 fbshipit-source-id: e5b65ad93e443fbba22164319c985ebc8424554a
-
Yedidya Feldblum authored
Summary: [Folly] Fix `exception_wrapper::throwException` when called before `main`. When the `exception_wrapper` is empty, then `throwException` emits a message to `std::cerr` and terminates. If called before `main` begins or after `main` ends, then `std::cerr` might not have been constructed yet or might have already been destructed. Bad. Segfault, etc. So we need to ensure that `std::cerr` is alive by holding an instance of `std::ios_base::Init`. Reviewed By: Orvid Differential Revision: D4576190 fbshipit-source-id: dd84b5e82eb6bd817d405baf530714e0f4c314c5
-
- 16 Feb, 2017 6 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Drop support for Clang < 3.9. Reviewed By: igorsugak Differential Revision: D4567233 fbshipit-source-id: cd94c711f0390d249b6736ab292721a477022b02
-
Christopher Dykes authored
Summary: MSVC 2015 has issues with templated `using` declarations using `decltype`, so adjust the definition to use constexpr evaluation to fill a template parameter of a base type instead. Reviewed By: yfeldblum Differential Revision: D4510155 fbshipit-source-id: cc2e33625b515085dff4e682971299810905fef0
-
Christopher Dykes authored
Summary: This includes both unused parameters (W4100) and conditional expression is constant (W4127). Reviewed By: yfeldblum Differential Revision: D4525057 fbshipit-source-id: 7c057dbe239d02fa2e3ce96373d53814591994ec
-
Christopher Dykes authored
Summary: They do the same thing, and the first is portable. Reviewed By: yfeldblum Differential Revision: D4569649 fbshipit-source-id: db0434766f674a7789d6e59335e122b4d2131e06
-
Maged Michael authored
Summary: Fixed a data race between an atomic store by the waker and a nonatomic memcpy by the waiter. Reviewed By: nbronson Differential Revision: D4572410 fbshipit-source-id: 3982ca433e0f628636916516e35aeb7738ae030f
-
Lovro Puzar authored
Summary: In D4558451 I want to pull elements off an atomic list onto a thread-local (single-consumer) vector and pop to get elements in insertion order. A sweep that provides elements in LIFO order will avoid a redundant pair of list reversals. Reviewed By: nbronson Differential Revision: D4564816 fbshipit-source-id: 38cf50418e6afe0be3eec96ce85d571c65f06d7e
-
- 15 Feb, 2017 3 commits
-
-
Philip Pronin authored
Summary: `defaultNumLowerBits` is heavily used during PL encoding with optimally-partitioned EF. This diff improves its performance by 3.5x by avoiding expensive 64-bit division. Reviewed By: ot, luciang Differential Revision: D4564615 fbshipit-source-id: 4521d3c05f19573cd2c84f702fcfeaace5f98e77
-
Phil Willoughby authored
Summary: The previous mechanism in SharedPromise doesn't work if the lifetime of the SharedPromise object ends before the Future which it was splitting is completed. This variation on the same theme doesn't have that problem. Reviewed By: spacedentist Differential Revision: D4339670 fbshipit-source-id: f619762bff1390481715575b3e638ec26b5c4edd
-
Anton Likhtarov authored
Summary: memcpy's src cannot be nullptr even if the size is 0. Reviewed By: djwatson Differential Revision: D4560100 fbshipit-source-id: 37cd3ed73f902a136f711a5c1a918258f94d1063
-
- 14 Feb, 2017 2 commits
-
-
Alex Malyshev authored
Summary: Intended to be used for case-insensitive prefix/suffix matching. Reviewed By: yfeldblum Differential Revision: D4552336 fbshipit-source-id: 0030b883426dd67bea27c3f878279359d51e1d33
-
Maxim Georgiev authored
Summary: Adding an interface to folly::AsyncSocket allowing to receive timestamp notifications collected using recvmsg(fd, MSG_ERRQUEUE, ...). Reviewed By: djwatson Differential Revision: D4329066 fbshipit-source-id: 154f5c0d04e5c0e410081d48c937af4069479fc2
-
- 11 Feb, 2017 1 commit
-
-
Adam Simpkins authored
Summary: Add explicit constructors to create Range objects referring to the contents of a std::array. D4165608 previously added a folly::range() factory function to create Ranges around const arrays. However, it did not support non-const arrays. However, providing this as a constructor seems better. This new constructor does not appear ambiguous with any existing constructors, and a constructor allows for more natural support of non-const arrays: the caller can explicitly indicate if they want to construct a Range to const or non-const data in this case. Reviewed By: yfeldblum Differential Revision: D4523515 fbshipit-source-id: c1a262f9e8f76907d87d80b03f252576506e70ab
-
- 10 Feb, 2017 3 commits
-
-
Andrii Grynenko authored
Reviewed By: lbrandy Differential Revision: D4544705 fbshipit-source-id: d60f2026d31c94e020df51f8c887b995986ddcd7
-
Jack Montgomery authored
Summary: folly/docs/Synchronized.md now reflects the fact that SharedMutex is default mutex for Synchronized Reviewed By: yfeldblum Differential Revision: D4529851 fbshipit-source-id: b3b8eafe908ba92e3629392fbc4b856b5a99b658
-
Andrew Krieger authored
Summary: D4499520 added typedefs to `dynamic` which made it start matching tests for ranges/containers. However, the typedefs are unconditional on the actual contents of the `dynamic`. This made toDynamic(dynamic) select the range-based conversion operator, always, which immediately asserts when trying to do range-based iteration over an Object or a primitive. Add tests to the converters that enable/disable depending on whether the object is already a `dynamic` and early-out in that case. Reviewed By: mzlee Differential Revision: D4538617 fbshipit-source-id: f3a5aafab07946a221dcead782fc27de51afa0a6
-
- 09 Feb, 2017 4 commits
-
-
Den Raskovalov authored
Summary: hasher<bool> is a trivial thing, but it is useful, if we implement a hash function for a class by writing something like: return folly::Hash()(boolField1_, boolField2_, intField3_, boolField4_, someField5_) Reviewed By: ot Differential Revision: D4535563 fbshipit-source-id: 5e6672c2eeaebbbac80a8a066a6a0ec4838810f4
-
Andrii Grynenko authored
Summary: EventBase and VirtualEventBase already had a loopKeepAlive() mechanism, which enabled libraries to prevent EventBase/VirtualEventBase from being destroyed until all keep-alive tokens were released. This change adds generic keepAlive() support into folly::Executor. folly::Executors which don't support keep-alive mechanism yet, will just return a no-op KeepAlive token. Reviewed By: yfeldblum Differential Revision: D4516649 fbshipit-source-id: 869779621c746cb14d985aa73bc4536859914c03
-
Phil Willoughby authored
Summary: Using the formatter is always much slower than using the copy constructor (News at 11). Comparing the two idioms for formatting out a single string input: * the unsafe method (`format(theString)`) is (annoyingly) fastest for small strings; probably because cache-hits dominate the need to inspect every character to see if it is `{` or `}` * the safe method (`format("{}",theString)`) is fastest on large strings (crossover at roughly 256 bytes) * there isn't a lot in it between 64 and 512 bytes. Reviewed By: yfeldblum Differential Revision: D4423088 fbshipit-source-id: 7f8590653ab33fe62887a506ea79a43989fbfb29
-
Andrew Krieger authored
Summary: Add non-const iterators corresponding to existing iterator types where it makes sense. Reviewed By: yfeldblum Differential Revision: D4499520 fbshipit-source-id: dc4ec583d3da1c6701805b30b25389fbf9311a7c
-
- 08 Feb, 2017 2 commits
-
-
Sebastian Messmer authored
Summary: This allows using folly::Optional<T> in std::unordered_map and std::unordered_set. Reviewed By: luciang Differential Revision: D4469938 fbshipit-source-id: b86b1a4510379b337e9de83471a4aafce6d5a6cb
-
Ameya Limaye authored
Summary: Throw custom exception type when ABD fails a result because some other token did not call dispatch: - This is useful because the caller can catch this exception and discard it if they find some other exception - The custom exception does not give an indication of the problem. The other exception/s thrown will do that. Reviewed By: yfeldblum Differential Revision: D4395742 fbshipit-source-id: be80f66b1297e9faf625a2fb087590a7d0a9335d
-
- 07 Feb, 2017 3 commits
-
-
Christopher Dykes authored
Summary: MSVC has warning 4800 which is triggered on implicit coercions to `bool` when not in use as the condition to a control-flow statement. Reviewed By: yfeldblum Differential Revision: D4518465 fbshipit-source-id: 858ab9e68215a2a667cb3ea55daf51b74368174d
-
Phil Willoughby authored
Summary: This decouples the format-string-parser from the storage of the arguments to be formatted: a static analyser can now define a class which derives from `BaseFormatter` with no storage and use `BaseFormatter::operator()` to verify the syntax of the format string and determine which arguments will be referenced. This method of allowing overrides is resolved at compile time; the benchmarks confirm that there is no run-time difference. Reviewed By: yfeldblum Differential Revision: D4507689 fbshipit-source-id: f109d81ae54dc074ac363720ef6e565520435d26
-
Phil Willoughby authored
Summary: Changes are planned, this will make it easier for the new code to look good without making the older code look weird. Reviewed By: yfeldblum Differential Revision: D4514839 fbshipit-source-id: 43f8cd7d85901e1915cc434a0f4b5fd6bce1ec7a
-
- 06 Feb, 2017 2 commits
-
-
Christopher Dykes authored
Summary: The rest of Folly isn't dependent on C++17 mode in MSVC, so modify this to support not having it enabled. This will make adoption easier as C++17 mode acts on the things the standard says are removed. Reviewed By: yfeldblum Differential Revision: D4509919 fbshipit-source-id: f4644f5f5ba78de8ab5192b89ac6320767b51084
-
Sven Over authored
Summary: Callable objects may implement a separate `operator()` for when they are called as rvalue references. For example, `folly::partial` will move captured objects to the function call when invoked as rvalue reference. That allows e.g. to capture pass a `unique_ptr` to `folly::partial` for a function that takes a `unique_ptr` by value or rvalue-reference. Callbacks for `folly::Future`s are only ever executed once. They may consume captured data. If the callback is an object that implements a `operator()() &&`, then that one should be invoked. This diff makes sure, callbacks passed to `folly::Future` are invoked as rvalue references. Reviewed By: ericniebler, fugalh Differential Revision: D4404186 fbshipit-source-id: 9f33e442a634acb8797183d3d869840d85bd5d15
-
- 04 Feb, 2017 2 commits
-
-
Andrey Ignatov authored
Summary: `TestConnectionEventCallback` and `TestAcceptCallback` are very handy and can be used in other tests outside folly. Specifically I'm going to use them in `ConnectHookTest`. It'll also allow to avoid copy/paste in `TransparentTlsTest`. Reviewed By: plapukhov Differential Revision: D4507461 fbshipit-source-id: dfaa97e26036ebb11da17a53d4a73431a295f4d4
-
Matt Glazar authored
Summary: environ is documented to not work very well from .dylib-s (dynamic libraries) on macOS. Use the _NSGetEnviron function instead to get a pointer to environ. <crt_externs.h> is missing from some iOS SDKs, so forward-declare _NSGetEnviron in such cases. Reviewed By: Orvid, mzlee Differential Revision: D4491044 fbshipit-source-id: 886d19bdd63dea14225992446b7ba132faf35054
-