- 10 May, 2016 9 commits
-
-
Kyle Nekritz authored
Reviewed By: siyengar Differential Revision: D3264727 fbshipit-source-id: fb10558096e73a3cbb6f2fb93296524c0206910d
-
Faidon Liambotis authored
Summary: These are pretty trivial. Debian's lint tool (lintian) warns about those in its verbose mode, and since we saw them when packaging for Debian, we thought of fixing them and forwarding them upstream. Closes https://github.com/facebook/folly/pull/345 Reviewed By: Orvid Differential Revision: D2769801 Pulled By: elliottneilclark fbshipit-source-id: ad37cc53792f21aae6558ba256f20cb56c6caab5
-
Jaak Ristioja authored
Summary: These didn't work properly in GitHub. Closes https://github.com/facebook/folly/pull/375 Differential Revision: D3281872 Pulled By: elliottneilclark fbshipit-source-id: b5398267ff5856bb6a7c4a3b963ae5cb47859bc3
-
Lucian Grijincu authored
Summary: It would be nice to fix, but it's going to be easier to do when folly support is for GCC>=5 which adds `__builtin_add_overflow`. For now disable the check as the Histgram code handles overflow correctly and has tests for these cases. Fixes need to be done for both float and integer types as Histogram is used with both. Reviewed By: meyering Differential Revision: D3280260 fbshipit-source-id: 56e524c517566a4547346859be7770eda2acee96
-
Lucian Grijincu authored
Summary: The result of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits are filled with zeros. If E1 has a signed type and non-negative value, and E1 × 2E2 is representable in the result type, then that is the resulting value; otherwise, the behavior is undefined. The code assumed the signed left shift worked like an unsigned left shift, so make that explicit. Reviewed By: meyering Differential Revision: D3280325 fbshipit-source-id: 178b95ee36b7a1126a79bb825c2ad2ffa6fa9464
-
Lucian Grijincu authored
Summary: third-party-buck/build/libgcc/include/c++/4.9.x/bits/stl_vector.h:866:9: runtime error: reference binding to null pointer of type 'char' ``` Breakpoint 2, 0x0000000000494894 in __ubsan_handle_type_mismatch_abort () (gdb) bt ``` Reviewed By: meyering, yfeldblum Differential Revision: D3279234 fbshipit-source-id: 63a761587e5b3f79ece09fc99b9a593da0e44b75
-
Christopher Dykes authored
Summary: MSVC's preprocessor is different in how it deals with passing arguments expanded from `__VA_ARGS__`, so we have to add a stub to force it to expand the arguments. Reviewed By: yfeldblum Differential Revision: D3256328 fbshipit-source-id: 551434833d40e55498a9ab352eb74acdfd094835
-
Christopher Dykes authored
Summary: MSVC doesn't define `__cplusplus` as a high enough value to trigger this, so add an explicit check for MSVC instead. Reviewed By: yfeldblum Differential Revision: D3271647 fbshipit-source-id: a1e5a5a7eb75dce066dfc7fae8b2086880dc4c3d
-
Lucian Grijincu authored
Summary: before: [ RUN ] RangeFunc.Vector bits/stl_vector.h:866:9: runtime error: reference binding to null pointer of type 'int' Reviewed By: yfeldblum Differential Revision: D3279253 fbshipit-source-id: 957a8ec050f5c3b27febf7e6cd16ad1d307da169
-
- 09 May, 2016 6 commits
-
-
Jim Meyering authored
Summary: Running the folly/io/test:compression_test with a UBSAN-enabled binary would fail with this: folly/io/test/CompressionTest.cpp:96:36: runtime error: shift exponent 16777216 is too large for 64-bit type 'size_t' (aka 'unsigned long') That exposed the unwanted left-shift. That made it so the actual "start" offsets were in the range [0..numThreads-1], rather than being e.g., with numThreads == 8, [0, 16777216, 33554432, ...]. Oops. Reviewed By: luciang Differential Revision: D3277606 fbshipit-source-id: 4bc48f84b0065de070b62a810f08b96e36ea7136
-
Christopher Dykes authored
Summary: Because it is the standard (well, Intel's standard) location for __m128i, and GCC, Clang, MSVC and ICC all implement it in that location. Reviewed By: yfeldblum Differential Revision: D3270872 fbshipit-source-id: fa0f0410670cdb310e656ca55ee0f568ca5ee06f
-
Lucian Grijincu authored
Reviewed By: meyering Differential Revision: D3277138 fbshipit-source-id: 7050d18c256ac15c8122d4af59aa31208b1466fd
-
Christopher Dykes authored
Summary: Due to some fun with the order MSVC does name lookup in templates, it ends up complaining that these are ambigious between folly::detail and folly::recordio_helpers::detail. The solution is to simply reference folly::detail explicitly. Reviewed By: yfeldblum Differential Revision: D3271606 fbshipit-source-id: e599ad8d8fe33b1e4ec0b838ddb5dfacfdf60159
-
Christopher Dykes authored
Summary: This fixes a few issues in the portability headers for MSVC. Not entirely sure how I managed to cause these in the first place, but this fixes them anyways. Reviewed By: yfeldblum Differential Revision: D3271859 fbshipit-source-id: 11a5d35246f29112563ee9079525aa37ced206ff
-
Philip Pronin authored
Summary: I would switch these to just use the intrinsic functions, but GCC 4.8 doesn't support them. MSVC supports the intrinsics, which is the primary reason for the switch. Reviewed By: yfeldblum Differential Revision: D3265572 fb-gh-sync-id: 3268f90d5234bdf77b3579504efd3dcd43f38aff fbshipit-source-id: 3268f90d5234bdf77b3579504efd3dcd43f38aff
-
- 07 May, 2016 1 commit
-
-
Andrii Grynenko authored
Summary: It's very unlikely that caller will handle such exceptions and FiberManager can proceed even if one task failed. DFATAL will ensure we still fail on such exceptions in debug builds. Reviewed By: yfeldblum Differential Revision: D3273573 fb-gh-sync-id: 55eba19c16429a3c89a2fdf5363fd4b55b3998a2 fbshipit-source-id: 55eba19c16429a3c89a2fdf5363fd4b55b3998a2
-
- 06 May, 2016 5 commits
-
-
Andrii Grynenko authored
Summary: Having singleton registered after registrationComplete() is called is not a hard failure. Replacing exception with ERROR, since we probably still want to avoid such situation. Reviewed By: yfeldblum Differential Revision: D3266376 fb-gh-sync-id: 8130d279775348c835265987c95189bd3d8106f9 fbshipit-source-id: 8130d279775348c835265987c95189bd3d8106f9
-
Christopher Dykes authored
Summary: I would switch these to just use the intrinsic functions, but GCC 4.8 doesn't support them. MSVC supports the intrinsics, which is the primary reason for the switch. Reviewed By: yfeldblum Differential Revision: D3265572 fb-gh-sync-id: f12d16b8f64cf48adcb97958d7ae88d56689a96f fbshipit-source-id: f12d16b8f64cf48adcb97958d7ae88d56689a96f
-
Christopher Dykes authored
Summary: Windows doesn't define a couple of functions. Reviewed By: yfeldblum Differential Revision: D2990676 fb-gh-sync-id: 1a1354bd7976cb8b4747436d6907d65210ba506c fbshipit-source-id: 1a1354bd7976cb8b4747436d6907d65210ba506c
-
Haijun Zhu authored
Summary: test console reports "address already in use" failure so add some randomness to it. Reviewed By: yfeldblum Differential Revision: D3265329 fb-gh-sync-id: a825cce787394783bb8d18d92385d2497b163385 fbshipit-source-id: a825cce787394783bb8d18d92385d2497b163385
-
Christopher Dykes authored
Summary: Windows doesn't have it, and it's used in a lot of places. Reviewed By: yfeldblum Differential Revision: D2997499 fb-gh-sync-id: fbf8f5f087b8f39197d5bf2177e4d34efd74631f fbshipit-source-id: fbf8f5f087b8f39197d5bf2177e4d34efd74631f
-
- 05 May, 2016 4 commits
-
-
Andrii Grynenko authored
Summary: Grouping all folly::ThreadLocal atfork hooks in one. This allows proper ordering between folly::ThreadLocal hooks and hooks added by other libraries (we always want folly::ThreadLocal hooks to be registered first). Reviewed By: ericniebler Differential Revision: D3262666 fb-gh-sync-id: 1aa928b9ddd484580f4a4a7b320e9e64164bb04a fbshipit-source-id: 1aa928b9ddd484580f4a4a7b320e9e64164bb04a
-
Andrii Grynenko authored
Summary: LoopKeepAlive can be useful to tell EventBase, that loop() shouldn't return even if there are no events registered, because some tasks will later be added via runInEventBaseThread. While at least one LoopKeepAlive is alive - EventBase::loop() behaves like EventBase::loopForever(). Reviewed By: yfeldblum Differential Revision: D3261706 fb-gh-sync-id: d91424d3d12cae11abd72cffdbd57f136f628dae fbshipit-source-id: d91424d3d12cae11abd72cffdbd57f136f628dae
-
Andrii Grynenko authored
Reviewed By: yfeldblum Differential Revision: D3244669 fb-gh-sync-id: 73fa4ecb0432a802e67ef922255a896d96f32374 fbshipit-source-id: 73fa4ecb0432a802e67ef922255a896d96f32374
-
Michael Lee authored
Summary: There are two places that still includes gflags/gflags.h: portability/GFlags.h and futures/exercises/Koan.h. Also removing gflags entirely from a couple of places which never reference it at all. Reviewed By: yfeldblum Differential Revision: D3203187 fb-gh-sync-id: e7725fbf2c4b3c475c0035e1b0e8c6e1227f277f fbshipit-source-id: e7725fbf2c4b3c475c0035e1b0e8c6e1227f277f
-
- 04 May, 2016 13 commits
-
-
Christopher Dykes authored
Summary: Windows doesn't have these functions under these names, so be nice to the code using it. Reviewed By: yfeldblum Differential Revision: D3003641 fb-gh-sync-id: 1657545af6975c96aea4a48c359250828b5921e0 fbshipit-source-id: 1657545af6975c96aea4a48c359250828b5921e0
-
Christopher Dykes authored
Summary: Windows has it, but all it does is define a few constants. Reviewed By: yfeldblum Differential Revision: D3002161 fb-gh-sync-id: a719faf391125522b2cb21471a56e8a9fe894225 fbshipit-source-id: a719faf391125522b2cb21471a56e8a9fe894225
-
Eric Niebler authored
Summary: `folly::Function` was an alias to a more complex type with template arguments that could not be deduced. For example, the call to `foo` below was failing to compile. ``` template <class R, class... As> void foo(folly::Function<R(As...)> f) { } int main() { foo( folly::Function<void(int)>{ [](int i){} } ); } ``` Rearrange the code so that folly::Function is no longer an alias, thus making its template arguments deducable. Reviewed By: luciang, spacedentist Differential Revision: D3256130 fb-gh-sync-id: fb403e48d161635b3b7f36e53b1679eb46cbfe7f fbshipit-source-id: fb403e48d161635b3b7f36e53b1679eb46cbfe7f
-
Andrii Grynenko authored
Summary: This diff implements two functions which can be used to bridge C++ asynchronous APIs with Python. 1. getExecutor(event_loop) allows extracting a folly::Executor-compatible object from Python event_loop. 2. wrapFuture wraps any folly::Future object in a Python Future object. Reviewed By: ambv Differential Revision: D2878731 fb-gh-sync-id: 83628b6b24d6039999f88c5de441e41064b2417e fbshipit-source-id: 83628b6b24d6039999f88c5de441e41064b2417e
-
Christopher Dykes authored
Summary: While the previous version did compile, it would generate warnings about symbols being defined in multiple places. Reviewed By: yfeldblum Differential Revision: D3255815 fb-gh-sync-id: 72f5079a3973a04bdc0b469b97ba46181e40353b fbshipit-source-id: 72f5079a3973a04bdc0b469b97ba46181e40353b
-
Christopher Dykes authored
Summary: MSVC doesn't have it, but Folly uses it, so implement it in the Builtins portability header. Reviewed By: yfeldblum Differential Revision: D3256123 fb-gh-sync-id: fd9ea1b6098d97cf1fde4732905bae9bde8cd8ad fbshipit-source-id: fd9ea1b6098d97cf1fde4732905bae9bde8cd8ad
-
Christopher Dykes authored
Summary: MSVC doesn't like it when you try to initialize a static in-class non-primitive constexpr member. It was only used in one place, so stick the definition in that function instead. Reviewed By: yfeldblum Differential Revision: D3255178 fb-gh-sync-id: e4a862a2662c4f5376c19fc52827cb2953f01e52 fbshipit-source-id: e4a862a2662c4f5376c19fc52827cb2953f01e52
-
Christopher Dykes authored
Summary: syscall() doesn't exist on Windows, but std::thread::id is standardized, and can do what we need it for, so use it instead. Reviewed By: yfeldblum Differential Revision: D3256064 fb-gh-sync-id: efddac82c117ccd8a53c8c93248529000b4326a5 fbshipit-source-id: efddac82c117ccd8a53c8c93248529000b4326a5
-
Christopher Dykes authored
Summary: MSVC doesn't like it, so the other uses were changed to .load() explicitly a while back, but this use has been added since then. Reviewed By: yfeldblum Differential Revision: D3255261 fb-gh-sync-id: 11d49902eb3ef7113a7c57cc760353554a487496 fbshipit-source-id: 11d49902eb3ef7113a7c57cc760353554a487496
-
Marcus Holland-Moritz authored
Summary: This is a workaround (maybe even the correct fix if it turns out that ASan can't detect this FP case) for the problem described in https://llvm.org/bugs/show_bug.cgi?id=27627 where a memory region previously allocated by a fiber stack can overlap with the region of an mmap'd file. Accessing parts of the mmap'd file close to the stack region will trigger a false positive ASan error. This change makes sure each fiber explicitly unpoisons its stack memory by calling __asan_unpoison_memory_region in an ASan-enabled build. Reviewed By: yhfung Differential Revision: D3257924 fb-gh-sync-id: 484062e80af67dfd39d2eaf3cbb52fa3483924eb fbshipit-source-id: 484062e80af67dfd39d2eaf3cbb52fa3483924eb
-
Pavlo Kushnir authored
Summary: this diff provides methods that allow to avoid temporaries while cloning IOBufs. Also optimizes move constructor a bit - there is no need to call `decrementRefCount`, check for self assignment, etc. Reviewed By: yfeldblum Differential Revision: D3250456 fb-gh-sync-id: 32b0180c28f36151c6786dba6f511b491b224200 fbshipit-source-id: 32b0180c28f36151c6786dba6f511b491b224200
-
Yedidya Feldblum authored
Summary: [Folly] Let `via` take a functor by universal reference. And perfect-forward the functor to the call to `then`. Reviewed By: fugalh Differential Revision: D3255684 fb-gh-sync-id: 1b46a70fb9de88d21d785c0ce4d9dd3078829f13 fbshipit-source-id: 1b46a70fb9de88d21d785c0ce4d9dd3078829f13
-
Christopher Dykes authored
Summary: The one header that doesn't split well. This is the last piece of the portability headers for Windows and is also the piece that has had the most thought put into it's design so-as to be as unintrusive as possible. Reviewed By: yfeldblum Differential Revision: D3046525 fb-gh-sync-id: 761a5e359bc130b95585608ee18fda94a30dae2c fbshipit-source-id: 761a5e359bc130b95585608ee18fda94a30dae2c
-
- 03 May, 2016 2 commits
-
-
Marcelo Juchem authored
Summary: `AsyncServerSocket::bind()` would not give information like port or family name when failing to bind a socket. This diff addresses that by including this information in the exception. Two additional helper methods were added to `SocketAddress` to retrieve both the port and the family name from a `sockaddr` structure. Reviewed By: ckwalsh, yfeldblum Differential Revision: D3249778 fb-gh-sync-id: 4edb28af5c211b7bf8d525b40844a5b0b6261e07 fbshipit-source-id: 4edb28af5c211b7bf8d525b40844a5b0b6261e07
-
Sven Over authored
Summary: This diff fixes a problem with passing move-only types to folly::via. Reviewed By: ericniebler Differential Revision: D3254906 fb-gh-sync-id: 8a9c703a8db0ccf20b9fb4fe9b80ad6cdcb3e388 fbshipit-source-id: 8a9c703a8db0ccf20b9fb4fe9b80ad6cdcb3e388
-