- 27 Apr, 2017 5 commits
-
-
Philipp Unterbrunner authored
Summary: Class template that wraps a reference to an rvalue. Similar to std::reference_wrapper but with three important differences: 1) folly::rvalue_reference_wrappers can only be moved, not copied; 2) the get() function and the conversion-to-T operator are destructive and not const, they invalidate the wrapper; 3) the constructor-from-T is explicit. These restrictions are designed to make it harder to accidentally create a a dangling rvalue reference, or to use an rvalue reference multiple times. (Using an rvalue reference typically implies invalidation of the target object, such as move-assignment to another object.) Reviewed By: yfeldblum Differential Revision: D4931483 fbshipit-source-id: 68453553bf4656ec41976699669a4491fcab79c9
-
Philip Pronin authored
Summary: `cpuid` uses all of `eax`, `ebx`, `ecx`, `edx` for output, but we aren't providing such information to GCC in a couple of cases, which might result in incorrect code being produced; GCC (unlike clang) doesn't allow the same register to appear both in input and clobber list, so put `eax` into output list where required. Reviewed By: ot, lbrandy Differential Revision: D4961841 fbshipit-source-id: 07ca1977373496bfd794d3b0c8a4ba21333820e4
-
Otto Ebeling authored
Summary: There's a gotcha case for IOBufQueue::split when n==0, it will then return an unique_ptr wrapping a nullptr, which many call sites do not expect. Reviewed By: meyering Differential Revision: D4868228 fbshipit-source-id: 418256dba8ca3bcfbae420b6099baa240055b9bb
-
Maged Michael authored
Summary: Added a lock holder with deferred option for cases where the caller may want to call try_lock() later. Reviewed By: djwatson Differential Revision: D4949736 fbshipit-source-id: 31e0dc349dc3af9d04a33878e26cef1e48cce674
-
Yedidya Feldblum authored
Summary: [Folly] Casing consistency for `exception_wrapper::throw_exception`. Reviewed By: Orvid Differential Revision: D4944818 fbshipit-source-id: 72056fb24ab6362e9a0319f73b5bbf8c92d658ca
-
- 26 Apr, 2017 5 commits
-
-
Pavel Aslanov authored
Summary: Pattern matching like functionality for boost::vairant. See unittests for usage examples. Reviewed By: yfeldblum, ericniebler Differential Revision: D4851133 fbshipit-source-id: cda7dc766dac5870bcc4ab1859de0e4e7f0a6599
-
Nick Terrell authored
Summary: 1. `emplace_back()` is broken when there are at least two arguments and one is a reference to inside the vector. See the `ForwardingEmplaceInsideVector` test. 2. Only `push_back(value_type&&)` did exponential growth, every other function grew linearly. The bug is hidden inside of facebook because `goodMallocSize()` grows fast enough to not be horribly slow. When not using jemalloc, it will grow one element at a time. 3. `push_back(value_type const& t)` performed a copy and a move on `t` when `size() == capacity()`. Remove the extra move. Fixes https://github.com/facebook/folly/issues/541. Reviewed By: luciang Differential Revision: D4875084 fbshipit-source-id: eefa76028c6bfd9d7c73af65e8bb9d4baf49b8cb
-
Dave Watson authored
Summary: Currently, contbuild has a blanket TSAN suppression for folly. Fix PicoSpinLock instead This should fix TSAN errors as an alternative to D4781776 Some of the tests even had TSAN errors, fixed those. Reviewed By: davidtgoldblatt Differential Revision: D4795284 fbshipit-source-id: 9f0fc6868399da2f86be355ce3c081990260a649
-
Dave Watson authored
Summary: virtual classes currently don't work in hazard pointers, and get incorrectly reclaimed. Reviewed By: magedm Differential Revision: D4951584 fbshipit-source-id: 8200df6bb8d500af2e89086edf7835d4fb90b6a2
-
Christopher Dykes authored
Summary: They allow for assignments that make no sense, so make it impossible to do so. Reviewed By: yfeldblum Differential Revision: D4919606 fbshipit-source-id: 24d8e036eff33a8c6def4672c0d098f0edd5c5b3
-
- 25 Apr, 2017 3 commits
-
-
Neel Goyal authored
Summary: Improve concurrency guards for `setSSLLockTypes` and `isSSLLockDisabled` by using initMutex. Also verify that openssl has been initialized w/ DCHECK in isSSLLockDisabled. We also add a method to do the setting of locks and initialization in one shot. Reviewed By: knekritz Differential Revision: D4937242 fbshipit-source-id: 308f516c17485281604d4322954c09beb58688e2
-
Andrii Grynenko authored
Reviewed By: vitaut Differential Revision: D4940976 fbshipit-source-id: 0c4ebf8f358e6f54a7b5e81f2e73649b030006c9
-
Christopher Dykes authored
Summary: `folly::setThreadName` is neither performance critical, nor (after this diff) is it a template, so exposing the mess that is its implementation to the world isn't worth it. The implementation is expected to get even more messy as I add support for getting the current thread's name, and eventually also add support for Windows as well. This also required exposing whether the current platform supports setting the name of the current or other threads. Reviewed By: yfeldblum Differential Revision: D4942401 fbshipit-source-id: 0e3be203995fa6ed667a5fd28dac7ba7fa49d683
-
- 24 Apr, 2017 1 commit
-
-
Michael Lee authored
Summary: Using `#ifndef __ANDROID__` does not necessarily handle all cases of gating the wchar tests Reviewed By: Orvid Differential Revision: D4938634 fbshipit-source-id: a2184e20b8c382e5a34947c029f7e3746272b407
-
- 22 Apr, 2017 2 commits
-
-
Neel Goyal authored
Summary: We set the actual locks on initialization, so attempting to change locks after had no affect, other than making isSSLLockDisabled() report incorrect information. Reviewed By: yfeldblum Differential Revision: D4935475 fbshipit-source-id: 7b80cd530801c925ade769163579b86b1a8f0027
-
Michael Lee authored
Summary: ^^^ Reviewed By: yangchi Differential Revision: D4934455 fbshipit-source-id: babf56f4705ae06f46b694df3f2890d4b9506861
-
- 21 Apr, 2017 3 commits
-
-
Michael Lee authored
Summary: The traitsLength call in the basic_fbstring constructor is returning a bad value. Reviewed By: Orvid Differential Revision: D4930106 fbshipit-source-id: 556a61c4496c2af91cb70db6d62cdc7e915edd55
-
Christopher Dykes authored
Summary: It was changed to a `void*` previously due to an ICE in GCC 4.7. GCC 4.7 hasn't been supported in quite a while, and newer versions of GCC don't crash, so it's time to switch it back to `nullptr_t`. Reviewed By: yfeldblum Differential Revision: D4917389 fbshipit-source-id: fc48642026c7e3aaeadef27bb949f70648c2312c
-
Cameron Pickett authored
Reviewed By: Orvid Differential Revision: D4921738 fbshipit-source-id: 69848cda3638fca4ead73dcc9949af0f600f33bb
-
- 20 Apr, 2017 2 commits
-
-
Andrii Grynenko authored
Summary: 1. Restrict EventBaseLocal API to only be used from EventBase thread to avoid extra locking. 2. Make sure objects stored in EventBaseLocal are destroyed in EventBase thread. Reviewed By: yfeldblum Differential Revision: D4918282 fbshipit-source-id: b7cb4c2b62fef85a9b1d796fa71af8af9087479d
-
Nicholas Ormrod authored
Summary: This change removes the unpackHack function from small_vector, which was blocking ##-Waddress-of-packed-member## from being enabled. The fix is split the pointer-getting non-const ##getCapacity## into a normal getter and setter. (lithium is flakey, according to continuous, and is push-blocking) Reviewed By: yfeldblum Differential Revision: D4918188 fbshipit-source-id: 435e030ad659f5dc9c42d90e9bfee9ca564a120a
-
- 19 Apr, 2017 3 commits
-
-
Maxim authored
Summary: Faced this problem on Ubuntu 14.04.4 LTS ``` configure:16581: error: possibly undefined macro: AC_MSG_NOTICE If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. autoreconf: /usr/bin/autoconf failed with exit status: 1 ``` Fixed with `apt-get install pkg-config` Closes https://github.com/facebook/folly/pull/579 Reviewed By: yfeldblum Differential Revision: D4886216 Pulled By: Orvid fbshipit-source-id: 88159b70bfcf62d01bef502b3a5da6c9d81499bc
-
Phil Willoughby authored
Summary: Any pair of read-compatible (same type, same traits) basic_strings (`basic_fbstring` or `std::basic_string`) can now be compared to each other with the `==`, `!=`, `<`, `>`, `<=`, and `>=` operators. If you have a C++14 environment this allows you to use the heterogeneous comparison lookup methods from N3657: you can query containers which store either string type with either string type efficiently. Reviewed By: yfeldblum, ot Differential Revision: D4905697 fbshipit-source-id: 2ea976ebf40af45d64c1d8c1c08847feb3b9db68
-
Andrew Krieger authored
Summary: portabilty/String.h defines functions for Windows which are provided by <strings.h> on other platforms, but doesn't include <strings.h> in that case. Reviewed By: Orvid Differential Revision: D4908770 fbshipit-source-id: b3326f78509c2aa1acb9c9279f01537b0a243400
-
- 18 Apr, 2017 5 commits
-
-
Marc Horowitz authored
Summary: On some platforms (iPhone 5C at least), ObjC/Objc++ BOOL is really signed char. There is code which expects this to be a boolean when converted to dynamic (and then to JSON and into JS), but the old code treated it as a number. This makes such code (like [mobileConfig getBool:]) fail to compile, so the developer needs to resolve the ambiguity one way or the other. Reviewed By: yfeldblum Differential Revision: D4648133 fbshipit-source-id: 76ece7803a1e966dca08bdb857af7990035544a0
-
Angelo Failla authored
Reviewed By: yfeldblum Differential Revision: D4898404 fbshipit-source-id: 82256ae3dcd76444dc1b192d3bb6d50f142cee81
-
Tianjiao Yin authored
Summary: According to [clang documentation](http://clang.llvm.org/docs/AttributeReference.html#no-sanitize-clang-no-sanitize), the format is incorrect. This results unit-test failure with ubsan. Reviewed By: yfeldblum Differential Revision: D4901777 fbshipit-source-id: e9d012366c5e1911632e47fa4fb690820b761fc3
-
Maged Michael authored
Summary: Modified FC stats. Added number of sessions and removed the number of out-of-memory record allocations. Removed locking from reading stats to avoid deadlock if the lock is already held. Reading stats now assumes exclusive access. Reviewed By: djwatson Differential Revision: D4857132 fbshipit-source-id: 81e4f25040af3691f3e82fe3794ee72c7ff53a99
-
Christopher Dykes authored
Summary: The pthread_t overload will die in the next diff, but cleanup needs to be done first. Reviewed By: yfeldblum Differential Revision: D4900830 fbshipit-source-id: d0cd56c5bd7fe22904f631c0cc64dff66448127c
-
- 17 Apr, 2017 2 commits
-
-
Christopher Dykes authored
Summary: This assumes I understand strict-aliasing rules correctly. Reviewed By: yfeldblum Differential Revision: D4900118 fbshipit-source-id: edba535d3ba799ac665d3f859dc4154b2c1b22cb
-
Maxim Georgiev authored
Summary: We should be able to reset error message callback in AsyncSocket evein if the socket is closed yet. It's common to keep callback installed while the socket is connected. Once the socket is closed, the deinitialization process starts. If the callback callee component gets deallocated before the socket object is deallocated, it should be able to cancel callbacks. Reviewed By: yfeldblum Differential Revision: D4897335 fbshipit-source-id: 8eee26f9ebcb78a01d55598be3aff6595a3ed852
-
- 16 Apr, 2017 1 commit
-
-
Angelo Failla authored
Summary: In a previous diff I added toInverseArpaName methods but I forgot to add the inverse. This change adds `IPVAddressV(46)::fromInverseArpaName` static methods. I have also implemented some suggestions that were in D4867502 but I couldn't incorporate because the diff was landed already. Reviewed By: yfeldblum Differential Revision: D4885198 fbshipit-source-id: b95752aa695d6675cb293f8df2daa1787383390f
-
- 15 Apr, 2017 4 commits
-
-
Eric Niebler authored
Summary: FBString.h doesn't really use any of the facilities defined in <ios>, such as the stream manipulators. No sense dragging it into FBString.h. This could potentially break downstream users if they are not already including the io facilities they are using. It's unlikely though because the actual stream types (std::ostream, std::istream) and stream objects (std::cout, std::cin) are defined in other headers that #include <ios>. Reviewed By: yfeldblum, Orvid Differential Revision: D4886133 fbshipit-source-id: 56adb93280eeeef8b09320b30fb224d4f72707bf
-
Tudor Bosman authored
Summary: What it says on the tin. Add the exception_tracer library to the folly OSS build, enabled with `--enable-exception-tracer`. Closes https://github.com/facebook/folly/pull/580 Reviewed By: Orvid Differential Revision: D4895533 Pulled By: yfeldblum fbshipit-source-id: 4878826c71e7d6af17845b23abc07dc48ea1aa51
-
Christopher Dykes authored
Summary: This is the last piece needed to get Folly working on Windows without PThreads. Updating Folly's test suite to support compiling without PThreads will come next. Reviewed By: yfeldblum Differential Revision: D4894048 fbshipit-source-id: 6076317e1364aef82a5d3cb306bea7c2226b3cdc
-
Christopher Dykes authored
Summary: It's unused, and MSVC is warning about that fact. Reviewed By: anirudhvr Differential Revision: D4894403 fbshipit-source-id: 767b944eb9fa0376c795555357c09bbf9179e24f
-
- 14 Apr, 2017 4 commits
-
-
Andrew Krieger authored
Summary: Several other warnings that aren't reasonable to disable globally occur in folly headers. - Wrap the unreachable code warnings in MSVC specific disable blocks to prevent problems for users. - Use more careful bit twiddling instead of negating unsigned types - Enable a simpler overload for bool->float conversion than one which attempts float->bool. - Delete one unneeded undef. Reviewed By: yfeldblum Differential Revision: D4891583 fbshipit-source-id: 4d2efda1fe720abcb083bf29b578c065127cda24
-
Christopher Dykes authored
Summary: Rather than duplicating logic (and #ifdefs), just call the helper function instead. Reviewed By: yfeldblum Differential Revision: D4888362 fbshipit-source-id: f5096f6029cf05526aa74bd40235ac8014824789
-
Christopher Dykes authored
Summary: It was previously returning a pointer masquerading as a `uint64_t`. Reviewed By: yfeldblum Differential Revision: D4888325 fbshipit-source-id: 6cf6ed09f0e7a39a8a2f93d3fa14b06913c27805
-
Christopher Dykes authored
Summary: Folly is gaining support for compiling without PThread support on Windows, but we need a way to know that at compile-time for certain APIs. This also includes changes to guard the only API outside of portability/PThread.h that needs to be guarded on the existence of PThread. Reviewed By: yfeldblum Differential Revision: D4889526 fbshipit-source-id: 21175ad90f60a47718c7e2775e3b429b2aad62e2
-