- 12 Nov, 2016 1 commit
-
-
Martin Martin authored
Summary: I accidentally forgot to specify the capacity for my MPMCQueue. When I then did a blockingRead(), I got a SIGFPE. Thanks to a custom signal handler that doesn't print stack traces, and a few more comedy of errors, I lost a day to this. With this patch, I would have gotten an assertion failure instead. Reviewed By: yfeldblum Differential Revision: D4169033 fbshipit-source-id: fab97ea0d5afc3c06885758b31a5e8c91ae75a45
-
- 11 Nov, 2016 4 commits
-
-
Mirek Klimos authored
Summary: We currently store the previous value on creation of RequestContextScopeGuard and reset it to the previous one when it goes out of scope - this means that if it's not unset properly somewhere, we'll prolong its life by saving it and restoring later. We need to do this because of some edge cases but a RequestContext should generally never be overridden by a different RequestContext - let's add a warning if this happens Reviewed By: djwatson, palmtenor Differential Revision: D3971904 fbshipit-source-id: e72b5f01102d18977d8aa5f8dca5a7802545098a
-
Andrew Gallagher authored
Reviewed By: yfeldblum Differential Revision: D4162763 fbshipit-source-id: 25c9bfae2e7679f4b98a3d64ee9f2319eb6e7f4a
-
Yedidya Feldblum authored
Summary: [Folly] Let `folly::range(const std::array<...>&)` be `constexpr`. This may be useful for future work. Reviewed By: simpkins Differential Revision: D4165608 fbshipit-source-id: 8f1064c3cdc07301e198acd596ff26724d603cdd
-
Jim Meyering authored
Summary: Fix these macros not to self-shadow for nested uses. How? Make each local variable name include __LINE__. This works in most cases, but not all: if you put the nested uses all on one line, you'll still get shadowing warnings. Reviewed By: yfeldblum Differential Revision: D4161553 fbshipit-source-id: 9e11ae6778272c733a4c820cfb30c5db59998a5b
-
- 10 Nov, 2016 5 commits
-
-
Christopher Dykes authored
Summary: Because the intrinsic version requires explicitly adding `__target__` attributes, which results in things not being inlined. Although the code generated with the `__target__` attribute is strictly better, ensuring it's applied on all the relevant functions is error-prone, so just use the inline assembly version for GCC/Clang so that it can be inlined elsewhere. MSVC will inline the intrinsic version without any issue. This also marks the functions as `ALWAYS_INLINE`, as the diff that is getting reverted made that change as well. Reviewed By: yfeldblum, philippv, ot Differential Revision: D3963935 fbshipit-source-id: 47175d64e7be351eb455a4d053b91ce9392bf152
-
Tudor Bosman authored
Summary: Some include files are not installed, causing including symbolizer/Symbolizer.h to fail. Closes https://github.com/facebook/folly/pull/512 Reviewed By: philippv Differential Revision: D4161113 Pulled By: luciang fbshipit-source-id: 5a5f8577f8d84ba33f89073781d374b99ba37df6
-
Christopher Dykes authored
Summary: Because, unfortunately, it isn't exported from the dynamic CRT dlls :( There's not really a nice way to handle this when using the dynamic CRT without doing very fragile hocus-pocus that relies on the exact layout and implementation details of the file descriptor table in the CRT, so the best we can really do is close the socket and just let the file descriptor itself leak. Reviewed By: yfeldblum Differential Revision: D4156558 fbshipit-source-id: 32cb4bf357f6746cf6597b66649ff9f018fb1bed
-
Phil Willoughby authored
Summary: Create a local std::ios_base::Init instance to ensure that it is valid, then use std::cerr. Reviewed By: yfeldblum, nbronson Differential Revision: D4139681 fbshipit-source-id: 03377dd417710e320a6b53298d507fd0168592f6
-
Andrii Grynenko authored
Reviewed By: yfeldblum, nbronson Differential Revision: D4149681 fbshipit-source-id: 37bd1b0b7d1ad6e6fa813228307abebfe772012f
-
- 09 Nov, 2016 8 commits
-
-
Christopher Dykes authored
Summary: Because GTest doesn't support it on platforms that don't implement `sigaction`. Reviewed By: yfeldblum Differential Revision: D4155882 fbshipit-source-id: fe8df316242b293afaf94c2a5d0f8a5e60b51285
-
Christopher Dykes authored
Summary: As the comment says, this disables a couple of warnings related to exporting classes derived from stdlib classes that aren't explicitly exported. Reviewed By: yfeldblum Differential Revision: D4155978 fbshipit-source-id: 6e732b53c280a3bc3a39b2128cd577ba7cb70408
-
Christopher Dykes authored
Summary: Because MSVC generates warnings if you have a control-flow statement followed by a single trailing semicolon. Reviewed By: yfeldblum Differential Revision: D4155588 fbshipit-source-id: dfd8774fc6a62675764f7e069c26b799b622a9af
-
Christopher Dykes authored
Summary: Without this flag, we were unintentionally requesting a context with access to private keys. Reviewed By: yfeldblum Differential Revision: D4155525 fbshipit-source-id: f33d18451b06e32b81d03bf6180efc1671cfa204
-
Christopher Dykes authored
Summary: Because `CHECK_EQ` is a fatal error, and makes it impossible to keep running the other tests if it fails, even if it was just a timeout. Reviewed By: yfeldblum Differential Revision: D4151084 fbshipit-source-id: db88dc2ef875e5d1fe31792f26a3dc2d223ded5e
-
Christopher Dykes authored
Summary: So that they can be run independently of the tests. Reviewed By: yfeldblum Differential Revision: D4150331 fbshipit-source-id: 3ab39024795add84885436b757f2505527297a3d
-
Christopher Dykes authored
Summary: When the implementation of `clock_gettime` for `REALTIME` and `MONOTONIC` was switched to use `std::chrono`, this didn't get switched over to the resolution of the new implementation. Reviewed By: yfeldblum Differential Revision: D4150297 fbshipit-source-id: a4578af85cae538a3ebb6da7e759058927c31d3e
-
Ali Zaveri authored
Summary: Expose isFamilyInet() in SocketAddress. This cleans up code and provides a way to validate if SocketAddress is a ipv4 or ipv6 Differential Revision: D4150650 fbshipit-source-id: dc8883e904b6577fc27bdd54064fcc50de93b0d2
-
- 08 Nov, 2016 3 commits
-
-
Christopher Dykes authored
Summary: The min value of a `char` is `-128`, but we're initializing our `size_t` i's with it, so, as MSVC quite rightly warns (as C6294) the condition is never true and the loop never loops. Fix it by signing our i's. Reviewed By: yfeldblum Differential Revision: D4145419 fbshipit-source-id: 87591d0f84c54472b1b5847e025d091de3f98bca
-
James Sedgwick authored
Summary: this diff adds tryReadUntil, which is a mirror of tryWriteUntil in both function and implementation. Two bugs were exposed in the process of implementing and testing tryWriteUntil; they are fixed as well and are as follows: 1. tryObtainPromisedPopTicket didn't assign to the passed ticket return reference in the failure case 2. TurnSequencer::tryWaitForTurn() didn't distinguish between past turns and timeouts in the failure case; they need to be differentiated because SingleElementQueue::tryWaitFor{De/En}queue() should only fail in the timeout case, not if the turn has passed. The two added unit tests are admittedly clumsy, but making the obvious simplifications to them keeps them from triggering the premature timeout race caused by bug 2 above, so I kept them as is. Reviewed By: magedm Differential Revision: D4050515 fbshipit-source-id: b0a3dd894d502c44be62d362ea347a1837df4c2f
-
Andrew Gallagher authored
Summary: These functions contain static locals which need to be exported to the global dynamic symbol table to get deduplicated at runtime. Since using `-fvisibility-inlines-hidden` demotes the visibility of these static locals, explicitly tag them. Reviewed By: yfeldblum Differential Revision: D4139154 fbshipit-source-id: 08b81721c6c945ac5556472481ae771d0eeb5f88
-
- 07 Nov, 2016 2 commits
-
-
Stepan Palamarchuk authored
Summary: `prepareReadBuffer` is calling a callback function that is not a noexcept also `prepareReadBuffer` is being called only from one place, that wraps this function call with try/catch. Reviewed By: jmswen Differential Revision: D4138424 fbshipit-source-id: a05bdd6f741761567a7d0291017c285b0bf15522
-
Andrew Gallagher authored
Summary: This tags certain static locals, wich may get duplicated via dynamic linking and inlining, as safe to have multiple copies at runtime, making this subtle behavior explicit. Reviewed By: igorsugak Differential Revision: D4082929 fbshipit-source-id: ba4e23cb121e957a43f5659a1ca3432cb89cb8f3
-
- 06 Nov, 2016 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Let `folly::range` be `constexpr`. It will be useful to have this helper function be `constexpr` to support further compile-time code. Reviewed By: juchem Differential Revision: D4135943 fbshipit-source-id: a62be93f9e492ca302130d1a3b190ed4b69f7a80
-
- 05 Nov, 2016 1 commit
-
-
Christopher Small authored
Summary: add operator== against nullptr_t for ReadMostlySharedPtr Reviewed By: andriigrynenko, nbronson, yfeldblum Differential Revision: D4128722 fbshipit-source-id: 40d08bb85bfe2f96ad4ed4995f5829e0616d0661
-
- 04 Nov, 2016 2 commits
-
-
Zach Amsden authored
Summary: Eden uses this and won't build with OSS folly without it. Reviewed By: Orvid Differential Revision: D4132103 fbshipit-source-id: 68d6c7dc642a7401eca60b0713db9f90cc11ced1
-
Mirek Klimos authored
Summary: Changed RWSpinLock to a SharedMutex in the RequestContext to see if this would lower the overhead of the onSet/onUnset callbacks. Reviewed By: djwatson Differential Revision: D3780396 fbshipit-source-id: 3d91f8194357533072fe053d23e0454a36faecff
-
- 03 Nov, 2016 8 commits
-
-
Kyle Nekritz authored
Summary: This allows getting up to n bytes from the queue without first having to check the length. Reviewed By: yfeldblum Differential Revision: D4083484 fbshipit-source-id: 2a468992c97f036c22f1a0d9f830e6d5286a4bc2
-
Kyle Nekritz authored
Summary: This is helpful for parsing data IOBufs in reverse. Reviewed By: siyengar Differential Revision: D4082810 fbshipit-source-id: 6a201d25e7d22befe28f92e4a1d7aa41ad7d6817
-
Louis Brandy authored
Summary: gcc-4.9 doesn't appreciate this clever loop and worries about `prev` being uninitialized on first use. Assuming the rest of the program behaves properly and preserves the invariant this code is expecting, this isn't bugged. But let's initialize it anyway. Reviewed By: meyering Differential Revision: D4120746 fbshipit-source-id: 1a7c323a4b6296a81768a62dd7d72337c5c35bf0
-
Jim Meyering authored
Reviewed By: yfeldblum Differential Revision: D4120553 fbshipit-source-id: 87c202232bcfabeff7eb62a8133b9b5577b09cbc
-
Jim Meyering authored
Summary: There was a doubly-nested loop, both with index "i". Change the inner for-loop index from i to j. Reviewed By: yfeldblum Differential Revision: D4120589 fbshipit-source-id: c786d8f7bb1ee05fc990db898b15836032e93940
-
Jim Meyering authored
Reviewed By: jsedgwick Differential Revision: D4120563 fbshipit-source-id: c97645a068662e41d5038bcd1e9805bdf6f0490c
-
Ameya Limaye authored
Summary: Allow getting the sequence number of a token via a read only getter function Reviewed By: yfeldblum Differential Revision: D4120900 fbshipit-source-id: b664dda29d13a1755e041ab9c33c0d7324690ba7
-
Andrii Grynenko authored
Reviewed By: yfeldblum Differential Revision: D4086486 fbshipit-source-id: bd0cca8dd2c9b74d5c30e4cd095191c1d1ecab79
-
- 02 Nov, 2016 3 commits
-
-
Tudor Bosman authored
Summary: Solves #509 by creating a libtool convenience library that's compiled with -msse4.2. Closes https://github.com/facebook/folly/pull/510 Differential Revision: D4120400 Pulled By: yfeldblum fbshipit-source-id: bf5d937dc37ef8707e755c89f1883d65b4d21b0f
-
Philip Pronin authored
Summary: We would like to guarantee that after `folly::ThreadLocal<>` dtor returns no per-thread instances are longer alive. Currently this is not a case: * T1 is excuting `StaticMetaBase::onThreadExit()`, it acquired all per-thread instances and erased them from meta under `accessAllThreadsLock_`. * T2 destroys `folly::ThreadLocal<>`, it executes `StaticMetaBase::destroy()`, collects all per-thread instances (thus missing the ones being destroyed by T1), destroys them and returns. * T1 executes dtor of per-thread instances, after parent `folly::ThreadLocal<>` dtor is finished. Reviewed By: ot Differential Revision: D4109820 fbshipit-source-id: d547b8cc77c9871126538c38644c2e98ddccf220
-
Ameya Limaye authored
Summary: Make sequence number in AtomicBatchDispatcher<....>::Token non-const: - The field is already private and having it as const prevents a move assignment operator from getting defined Reviewed By: yfeldblum Differential Revision: D4114851 fbshipit-source-id: 9f7a4003daff02c007c01747cca6ae9da17fcb79
-
- 01 Nov, 2016 2 commits
-
-
Christopher Dykes authored
Summary: MSVC doesn't allow uninitialized non-`extern` `const` declarations, but we can't mark them `extern` because they are part of a template specialization. We also can't initialize them, because they'd conflict with the definition specializations in the generated tables. As the forward-declarations aren't required for it to work under MSVC, as the specializations are found appropriately, just don't declare the specializations under MSVC. Reviewed By: yfeldblum Differential Revision: D4098282 fbshipit-source-id: 84b73d63bbe6cf9c54b7fe7a3bfc2488699df7c2
-
David Callahan authored
Summary: In the next revision of clang, compilation generates multiple erroes of the form folly/TokenBucket.h:127:29: error: exception specification is not available until end of class definition double nowInSeconds = defaultClockNow()) { which are eliminated by reordering the method declaration for defaultClockNow() Refer https://llvm.org/bugs/show_bug.cgi?id=30860 Reviewed By: philippu, yfeldblum Differential Revision: D4107443 fbshipit-source-id: ce64f2ae7983e533c2fcb5cb043dbdd3da5c00f7
-