- 04 Aug, 2016 6 commits
-
-
Christopher Dykes authored
Summary: There are a few places that need this, so make it so. Reviewed By: yfeldblum Differential Revision: D3667234 fbshipit-source-id: 84c16e1b036d9c2afddf03aa84c43210c5672f0a
-
Christopher Dykes authored
Summary: Well, make it compile anyways. There's no simple equivelant for Windows, so just return 0 instead. Reviewed By: yfeldblum Differential Revision: D3667474 fbshipit-source-id: 02224c6666dfcfdec237bfbbd4714170407a952a
-
Christopher Dykes authored
Summary: Because they simply didn't work before. Reviewed By: yfeldblum Differential Revision: D3666894 fbshipit-source-id: 7a34073b2bbc43c489ad963c28fac24dcbb187f2
-
Nick Terrell authored
Summary: `RangeEnumerator`s `begin()` and `end()` could return different values, but `Enumerator`s `operator ==` didn't support comparision with different types. Reviewed By: yfeldblum Differential Revision: D3662576 fbshipit-source-id: cfd10fffd220c70191ce0ac2ed78edd35daf5538
-
Christopher Dykes authored
Summary: There is no reason at all for this to be a macro, so get rid of the macro. Reviewed By: igorsugak, yfeldblum Differential Revision: D3666339 fbshipit-source-id: cf131fd4182fe89c5ce0c981edf9bd7fb46158a9
-
Christopher Dykes authored
Summary: Because, if you aren't compiling with `WIN32_LEAN_AND_MEAN`, including `WinSock2.h` will result in `small` being `#define`'d as `char`. The best way to work around the issue is to simply change the name of the member to something else. It would also have been possible to solve the problem by adding a section to `folly/portability/Windows.h`, but that would have required including that header in `folly/Function.h`, which there really is no reason to do. Reviewed By: yfeldblum Differential Revision: D3666417 fbshipit-source-id: 21c0363a4b77bb01e4ec20b2fc625c40729879c3
-
- 03 Aug, 2016 9 commits
-
-
Christopher Dykes authored
Summary: The mode parameter to `open` under MSVC is not the same as the mode parameter everywhere else, so we need to do a bit of translation. Reviewed By: yfeldblum Differential Revision: D3651218 fbshipit-source-id: 80df1e15f34b8d66533256107d8c9218f757fde2
-
Christopher Dykes authored
Summary: This code was relying on the `- 1` overflowing as a 64-bit value, but MSVC (correctly in my opinion) was overflowing this as a 32-bit value, resulting in a segfault when trying to run the bitvector and eliasfano tests on MSVC. Reviewed By: yfeldblum Differential Revision: D3652343 fbshipit-source-id: 38a22abfc0d05ab2f070c450eebfa69af07d26af
-
Mirek Klimos authored
Summary: We need to make sure RequestContext is unset properly for correct attribution of events to requests in BPF. djwatson, is there a reason not to set RequestContext when running runLoopCallbacks() from EventBase destructor? Reviewed By: yfeldblum Differential Revision: D3640289 fbshipit-source-id: bc48e936618adb1a1619de004b8479f58d3b683d
-
lpathy authored
Summary: Closes https://github.com/facebook/folly/pull/429 Reviewed By: mzlee Differential Revision: D3649806 Pulled By: Orvid fbshipit-source-id: 77288e0a1aedf15a18f558e18fbc1dc3a56e5fd6
-
Christopher Dykes authored
Summary: Because I fail at typing underscores apparently. This also switches the shifts over to using `kLockBitMask_` instead, which was already defined for us. Reviewed By: yfeldblum Differential Revision: D3652483 fbshipit-source-id: 6bd527beeb90bea8ee7632c0a3bfbbb9e0a7e2e7
-
Alexander Stocko authored
Summary: Fixes make check problem for MallctlHelperTest. Previous make check output: MallctlHelperTest.o: In function `MallctlHelperTest_valid_read_Test::TestBody()': MallctlHelperTest.cpp:(.text+0x25): undefined reference to `testing::internal::AlwaysTrue()' MallctlHelperTest.cpp:(.text+0x2e): undefined reference to `testing::internal::AlwaysTrue()' MallctlHelperTest.cpp:(.text+0x51): undefined reference to `testing::Message::Message()' MallctlHelperTest.cpp:(.text+0x72): undefined reference to `testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)' MallctlHelperTest.cpp:(.text+0x85): undefined reference to `testing::internal::AssertHelper::operator=(testing::Message const&) const' MallctlHelperTest.cpp:(.text+0x91): undefined reference to `testing::internal::AssertHelper::~AssertHelper()' MallctlHelperTest.cpp:(.text+0xe4): undefined reference to `testing::Message::Message()' MallctlHelperTest.cpp:(.text+0x111): undefined reference to `testing::inte Closes https://github.com/facebook/folly/pull/448 Reviewed By: yfeldblum Differential Revision: D3659427 Pulled By: Orvid fbshipit-source-id: c1445b881bbebdace4defc02024a5184fd821ed6
-
Yuri Putivsky authored
Summary: folly AsyncPipeReader takes a callback of type AsyncReader::ReadCallback. Now AsyncReader::ReadCallback class supports IOBuf as a buffer for transfer read bytes. Need to extend AsyncPipeReader class to support IOBuf as well Reviewed By: yfeldblum Differential Revision: D3650893 fbshipit-source-id: e2142341c8b8b0b2ef248c1f13a8caba9d50ba67
-
Maged Michael authored
Summary: Depends on D3648146 Atomic counter test with: - Buggy path triggered by an env var - Auxiliary data - A global invariant - A function to be called with shared accesses to update auxiliary data and check the global invariant. Reviewed By: djwatson Differential Revision: D3648195 fbshipit-source-id: 18620a887f114abf31ba1261c38287139a1591a7
-
Gustavo Serra Scalet authored
Summary: - unused variables - suppressing "warning: variable length array ‘vec’ is used [-Wvla]" Closes https://github.com/facebook/folly/pull/443 Reviewed By: djwatson Differential Revision: D3641928 Pulled By: Orvid fbshipit-source-id: 0bd58a75f8948f28cc2d232c03bd443734d9657d
-
- 02 Aug, 2016 5 commits
-
-
Maged Michael authored
Summary: Support for user-defined auxiliary variables and global invariants. - Add two fields to DSched: -- tls_aux: static FOLLY_TLS std::function<void(uint64_t, bool)>*. User-defined auxiliary function with parameters: count of synchronization steps, and boolean indicator of the success of the current step. -- step_: uint64_t. Count of shared accesses that correspond to user synchronization steps (atomic accesses for now). - Add two static functions to DSched: -- void setAux(std::function<void(uint64_t, bool)>*). -- void callAux(bool success). Calls the aux function with the step count and the bool success argument. - Add a version of afterSharedAccess(bool) that takes a bool success parameter and calls callAux(success). This version is used in every atomic operation of DeterministicAtomic. - Add direct load interface to DeterministicAtomic for use by auxiliary functions. Note: This the base of a stacked diff with: - Test the new capabilities in DeterministicScheduleTest.h Next steps: - Use the new capabilities to test dynamic MPMCQueue Other possible additions: - Change the implementation of DeterministicMutex to allow inspecting its internal state. - Test the new capabilities for mutexes and semaphores in DeterministicScheduleTest.h - Performance optimization: e.g., user-space context switching, using regular variables to implements atomics. Reviewed By: djwatson Differential Revision: D3648146 fbshipit-source-id: 4f838ff7cfd41ab71cfdf22bb67def3221948311
-
Sahil Jain authored
Summary: Regenerate README after updating dex_export.php Reviewed By: fugalh Differential Revision: D3654216 fbshipit-source-id: aaae04803c480e2ecaf9b3cb8794c8d8f7df560b
-
Dave Watson authored
Summary: Currently, getVia(eventbase) will busy wait if no work is scheduled on the event base. Tweak the DrivableExecutor API a bit to support sleeping/wakeups. There was already a similar fix for the only other existing DrivableExecutor, the ManualExecutor, in D2906858. Reviewed By: andriigrynenko Differential Revision: D3613954 fbshipit-source-id: 9ff9f2e010040d9886fdf51a665e3afabbff57c0
-
Aravind Anbudurai authored
Summary: I want to be able to read from an fd into an std::string and this diffs helps with that. Reviewed By: yfeldblum Differential Revision: D3654709 fbshipit-source-id: d48e8001a50f90c66cbe5b4a3b536c7b0074c39d
-
Igor Sugak authored
Summary: libc++ doesn't implement `std::abs` as template. ```lang=bash ./../folly/fibers/Fiber.h:68:34: error: unexpected type name 'intptr_t': expected expression const size_t size = std::abs<intptr_t>( ^ ``` Reviewed By: markisaa Differential Revision: D3645584 fbshipit-source-id: a2d672137f110b975412a94ae4c6d00da0bd0d43
-
- 01 Aug, 2016 6 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Remove the glog header include from `Assume.h`. Better to avoid unnecessary includes. Reviewed By: Orvid Differential Revision: D3652651 fbshipit-source-id: 3fa6256e9571539c692b9c50c1c215b31eef394a
-
Christopher Dykes authored
Summary: I was off by one in my implementation. Reviewed By: yfeldblum Differential Revision: D3651183 fbshipit-source-id: 4d6a6d08c06bce332a00088920bf604a10c942e7
-
Christopher Dykes authored
Summary: Just rename the parameter instead, it's not worth it. Reviewed By: yfeldblum Differential Revision: D3651065 fbshipit-source-id: ce11c35a7923ab7e10868cedb49c47c0b427fd0c
-
Christopher Dykes authored
Summary: A `long` is only 32-bits on MSVC, so this is simply wrong. Shift a `T` left instead. Reviewed By: yfeldblum Differential Revision: D3651139 fbshipit-source-id: 3bbfd18ed0c372287c4ec6cbcc543f6f1fcc4139
-
Christopher Dykes authored
Summary: Because the check macros attempt to pipe the values to the error stream, but we can't do that with the Windows implementation. Switch to `std::this_thread::get_id()` instead because it's standard and can be piped. Reviewed By: djwatson Differential Revision: D3650362 fbshipit-source-id: 8af65448a33949f310abc818d95bac843214b685
-
David Wilemski authored
Summary: Noticed this while reading the code. Reviewed By: yfeldblum Differential Revision: D3648565 fbshipit-source-id: c00940e5ce91fbc7e5cc6c42e35c5deee3e0bf65
-
- 30 Jul, 2016 1 commit
-
-
Aaryaman Sagar authored
Summary: Initializer list construction can often have conflictingly similar syntax as uniform initialization. As a result APIs and classes often either avoid using `std::initializer_list`s or deprecate construction with `std::initializer_list`s. This change provides a tag similar to `std::piecewise_construct_t` to help out. Reviewed By: simpkins Differential Revision: D3617276 fbshipit-source-id: 3c74802f946a22e1a4ee52eca0f89df4a028eb22
-
- 29 Jul, 2016 7 commits
-
-
Dave Watson authored
Summary: Test timers where we need to reschedule the wheel timer next tick. This wasn't tested before, since we were always ticking, and never needed to reschedule. Differential Revision: D3637103 fbshipit-source-id: cb80e7b790bb6aac68bdb5f60f8aa00caa2e5b69
-
Giuseppe Ottaviano authored
Summary: GCC's `__cxa_demangle()` uses on-stack data structures for the parser state which are linear in the number of components of the symbol. For extremely long symbols, this can cause a stack overflow. This diff introduces an arbitrary symbol length limit above which we just return the mangled name. Reviewed By: philippv Differential Revision: D3641115 fbshipit-source-id: ec360bb20ca499fd0eaf3a06c5bbcbd1e936d845
-
Anirudh Ramachandran authored
Summary: Similar to other getters such as getSSLCertSize, but returns a const X509*. This may be useful to get cert parameters after handshake is complete (or in error). Reviewed By: yfeldblum Differential Revision: D3636598 fbshipit-source-id: 98f0e2987de53d6343541ef0ed588f9ad18390cd
-
Dave Watson authored
Summary: Test doesn't match comments. Remove extranous commented code. I think there was actually a subtle bug in the test: since 25 doesn't evenly divide in to 6, we could end up farther away than we were expecting. The same is true of 10/3, but it remains within the threshold. Reviewed By: yfeldblum Differential Revision: D3637078 fbshipit-source-id: d9881143c33c9b4f203f839e2e5106183301b530
-
Sven Over authored
Summary: When future callbacks are to be executed by an executor (via `via`) and the executor does not actually execute the callback function (for whatever reason), then waiting for the final future (the one returned by `via`) block forever. In case the callback function that got passed to the executor gets destroyed without being executed, the future should be set to a folly::BrokenPromise exception instead of remaining unset forever. This diff modifies the reference counting in folly::detail::Core to make sure the reference held by the callback function is properly removed not only after the callback gets executed, but also when the callback is destroyed without having been executed. Reviewed By: yfeldblum Differential Revision: D3455931 fbshipit-source-id: debb6f3563384a658d1e0149a4aadbbcb268938c
-
Jim Meyering authored
Summary: Building/testing with ASAN would elicit a heap use-after-free. Differential Revision: D3639117 fbshipit-source-id: 30b5fa7d3fe1d804c4fba5bada8197a3a05a8333
-
Yuri Putivsky authored
Summary: takeOwnershipOfPipes should left zero heap memory allocated in folly:Subprocess class instance. Reviewed By: snarkmaster Differential Revision: D3638503 fbshipit-source-id: aac7b10bd7399c44868f32c01164f4123892598f
-
- 27 Jul, 2016 3 commits
-
-
Adam Simpkins authored
Summary: Add an unlock() method to Synchronized LockedPtr objects. This will make it easier to replace current users of the UNSYNCHRONIZED macro. Of the handful of places currently using UNSYNCHRONIZED, many of them want to simply release the lock before logging a message and returning. However, UNSYNCHRONIZED is a poor choice for this, since it will re-acquire the lock on scope exit. In these situations where the function returns from inside an UNSYNCHRONIZED block the code unnecessarily re-acquires the lock just to immediately release it. The unlock() method will provide a cleaner mechanism for these call sites to simply drop the lock early before returning. Reviewed By: yfeldblum Differential Revision: D3547652 fbshipit-source-id: 4d28fe9f3aad0d7348e918d1a3d6c705bfec242b
-
Christopher Dykes authored
Summary: MSVC gives warnings if you shift a 32-bit value left but then assign it to a 64-bit variable. This just makes it a 64-bit shift instead. If we really wanted, this doesn't need to be a size_t to begin with, but it already is, so just leave it alone. Reviewed By: yfeldblum Differential Revision: D3622935 fbshipit-source-id: 25931e6df644df8a2160aa80fd5de21cd9c06159
-
Wez Furlong authored
Summary: MAP_POPULATE is not defined on this system. Instead we will `madvise` the kernel that we will need it so that it will populate the mapping. Reviewed By: yfeldblum Differential Revision: D3584325 fbshipit-source-id: ece52f3d55c475bcd41367f4e9744d6f41001cd5
-
- 26 Jul, 2016 3 commits
-
-
Christopher Dykes authored
Summary: It was using inline assembly in order to get atomic single-bit operations, so add a variant for MSVC that uses intrinsics. MSVC is also weird in-that it doesn't have a 16-bit variant of these, so use an atomic OR and AND to achieve the required effect. Reviewed By: yfeldblum Differential Revision: D3623220 fbshipit-source-id: b4ff985ef2ed7787115f4d20de6f244123410dc8
-
Christopher Dykes authored
Summary: That way the mismatch warning can stay as an error. Reviewed By: yfeldblum Differential Revision: D3613761 fbshipit-source-id: 6e0ee42c658d95786f578f6500aba113c00d8f77
-
Christopher Dykes authored
Summary: While the previous version did compile, it wouldn't actually work at link time. Reviewed By: meyering Differential Revision: D3614424 fbshipit-source-id: 578677b65edca720330319594e1163d214e1400d
-