- 01 Dec, 2016 1 commit
-
-
Andrii Grynenko authored
Summary: folly::SingletonThreadLocal should be used for all thread-local singletons to avoid SDOF. Reviewed By: yfeldblum Differential Revision: D4253009 fbshipit-source-id: 5b4ca57a7a77b7b54c94630a2a29d13b84a3af27
-
- 30 Nov, 2016 3 commits
-
-
Christopher Dykes authored
Summary: Truncations should be explicit, but for some reason, MSVC seems to be the only compiler that will warn you when you implicitly truncate integer or float values. This allows Folly to be compiled with warnings 4018, 4242, 4244 and 4305 enabled. Technically 4018 is a sign mismatch warning, but there was only one place it was being triggered so I included it anyways. The other 3 are warnings for implicit truncation. There is one other implicit truncation warning that currently triggers in Folly, 4267, but there are a lot more places where that triggers so I'll do that in a separate diff. Reviewed By: yfeldblum Differential Revision: D4249471 fbshipit-source-id: e18a93d85856c998576934a6229c9edd1638a54e
-
Teng Qin authored
Summary: Using newly added `StaticTracepoint.h`, add a Tracepoint for `RequestContext` switch that could be enabled by compiler flag. Reviewed By: drarmstr Differential Revision: D4238658 fbshipit-source-id: 043a035ba8251b48d7b29d63a2219ad2edda164f
-
Eric Niebler authored
Summary: More constexpr is better! Reviewed By: yfeldblum, luciang, ot Differential Revision: D4244996 fbshipit-source-id: 30a9b726c115a92bb18538d7f18e50eccb0a1ef6
-
- 29 Nov, 2016 5 commits
-
-
Tiho Tarnavski authored
Summary: If a write request is buffered after a partial write, then bytes written is not updated after subsequent write operations (`performWrite`) for the buffered write request (`BytesWriteRequest`). This results in a wrong value for totalBytesWritten_, which is reported in the error callback in case the write request fails. Reviewed By: yfeldblum Differential Revision: D4205743 fbshipit-source-id: f77ca55ccfdceda1008c45e72ec093b00bf250e4
-
Andrii Grynenko authored
Summary: Make folly::Singleton fail if singleton is requested before registrationComplete. By doing this we disallow any folly::Singleton to be created before main(). Strict mode is still disabled for Python and Hs. Reviewed By: yfeldblum Differential Revision: D4121322 fbshipit-source-id: b66c23e24f6a7324cd12ddb77cad960e0950a1aa
-
Guo Xiao authored
Summary: Closes https://github.com/facebook/folly/pull/520 Reviewed By: pixelb Differential Revision: D4243347 Pulled By: yfeldblum fbshipit-source-id: cae0b36abdc7807afc188220f7f421f2a3bbc973
-
Nick Terrell authored
Summary: D4194834 broke the OSS build. Ubuntu 14.4 has r114 in its repo, so support it. Reviewed By: yfeldblum Differential Revision: D4224129 fbshipit-source-id: c85e95716ee1a08b33455bfe6fc9f7712d226edf
-
Christopher Dykes authored
Summary: Because MSVC isn't happy about it and generates a warning with a lot of context. Reviewed By: yfeldblum Differential Revision: D4242688 fbshipit-source-id: b1e26c9e3b58e7bac0e00ab8959358010fa610e8
-
- 28 Nov, 2016 2 commits
-
-
r8k authored
Summary: * include all dependencies * update `autoconf` & `configure` with correct params * include `make` & `make install` in the bootstrap for a better user experience * fixes #332 Closes https://github.com/facebook/folly/pull/513 Reviewed By: yfeldblum Differential Revision: D4177362 Pulled By: Orvid fbshipit-source-id: c62d6633c382fca57bb06db08724a7355b71bdb3
-
Yedidya Feldblum authored
Summary: [Folly] Canonicalize some aspects of the `folly/experimental/hazptr` test. * Remove the custom `main()` and use the provided weak symbol, either from `folly/test/common/TestMain.cpp` or from `gtest` depending on the build. * Extract some common setup/teardown (just debug logging in this case) to a test fixture. Reviewed By: Orvid Differential Revision: D4234154 fbshipit-source-id: 25613cba0ad6c9147714d98150e013fba1a64d46
-
- 27 Nov, 2016 1 commit
-
-
Phil Willoughby authored
Summary: Thanks nbronson for suggesting this fix. I don't see why this should make any difference (and nor does clang) but the important thing is that it works now. Reviewed By: nbronson Differential Revision: D4212670 fbshipit-source-id: 08b4313d736f237039a807fbc458d4d581a2ef35
-
- 25 Nov, 2016 3 commits
-
-
Christopher Dykes authored
Summary: Otherwise it won't work under MSVC where we don't have Futexes. This is achieved by using the Futex API already used elsewhere in Folly. Reviewed By: yfeldblum Differential Revision: D4233517 fbshipit-source-id: d6ae6a34b2287cf485f8e4a316445a2ba746d1a7
-
Christopher Dykes authored
Summary: This reverts commit 636ed5ae8ad36a323054efaad96d3756f1b7b9d0 Differential Revision: D4214296 fbshipit-source-id: 41fe55a8fcbf41cce44fee7ba65eda5aadbf97b3
-
Subodh Iyengar authored
Summary: When TFO falls back, it's possible that the fallback can also error out. We handle this correctly in AsyncSocket, however because AsyncSSLSocket is so inter-twined with AsyncSocket, we missed the case of error as well. This changes it so that a connect error on fallback will cause a handshake error Differential Revision: D4226477 fbshipit-source-id: c6e845e4a907bfef1e6ad1b4118db47184d047e0
-
- 24 Nov, 2016 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Suppress deprecation warnings in related tests. When a test specifically exercises a marked-deprecated library or a marked-deprecated part of a library, we do not need to see the deprecation warnings - they are noise. Specifically, `Singleton` and `Subprocess` have tested but marked-deprecated APIs, so we suppress deprecation warnings in those specific test suites. Reviewed By: andrewjcg Differential Revision: D4230826 fbshipit-source-id: 937b078029cde492906088caa3a9e5eee449bc12
-
- 23 Nov, 2016 4 commits
-
-
Christopher Dykes authored
Summary: It's called `.native()` for a reason, and returns a `wstring` on windows, so call `string()` instead. Reviewed By: yfeldblum Differential Revision: D4229254 fbshipit-source-id: d5f9658b41f45fd719ca3e878a2e61c9dce24f10
-
Teng Qin authored
Summary: Derived from `sdt.h` in [[ https://sourceware.org/systemtap/ | SystemTap ]] Performed changes and clean-ups including: - Get rid of the `sdt-config.h`. - Get rid of "Running in Assembler" code. - Replace the `DTRACE_PROBE_1, ... DTRACE_PROBE_N` Macro family with a single Macro using the "count Macro arguments" trick - Get rid of argument signed-ness calculation. A **lot** of painful code were there only for this, and it has no real usage except for displaying purposes. - Re-structure the helper methods (Macros) so that the logic of the code is a bit more readable. - Add some comments so that it would be easier for users and future developers to understand what this header file is actually doing. - Update license banner. Reviewed By: meyering Differential Revision: D3792966 fbshipit-source-id: 564a1011f7946d30be78191f334e072d94fa264e
-
Christopher Dykes authored
Summary: Even when linked against the dynamic runtime. In truth, the old way was far cleaner, but we do need to be able to close the file descriptors as there is a hard global limit set by the CRT when it's compiled of 8k file descriptors. This closes it by applying a flag that prevents calls to `CloseHandle` from actually closing the handle, then we call `_close` to get the file descriptor itself closed, then we can call `_closesocket` to close the socket and handle. This is complicated by the fact that attempting to close a handle that you've marked as being prevented from being closed will trigger an SEH exception, but only if you have a debugger attached. That means that, for anything closing sockets to be debuggable, we have to handle that exception (as a no-op) and then get to have fun trying to get `STATUS_HANDLE_NOT_CLOSABLE`, which for some absurd reason, is only defined as part of the driver developer kit's headers. Some fun ensued where VS was nice enough to point out that the bcrypt headers also defines `NTSTATUS`, and doesn't require building as a driver to use it. For that reason we borrow its definition of `NTSTATUS` rather than declaring it ourselves. We also have to prevent the main windows headers from defining the base SEH exceptions, because those will be redefined by `ntstatus.h` otherwise :( Reviewed By: yfeldblum Differential Revision: D4222625 fbshipit-source-id: 6ed7e91b7a735b5506eb189e452983cd8cace34b
-
Christopher Dykes authored
Summary: The helper exists because MSVC is a pain in this regard, so use it. Reviewed By: yfeldblum Differential Revision: D4224037 fbshipit-source-id: 6c6415877785f13ea91618a3042f2470dccd08c1
-
- 22 Nov, 2016 3 commits
-
-
Stepan Palamarchuk authored
Summary: There was a recent change in boost compatibility that changed fibers internals and thus broke this script. This diff fixes gdb script to properly print stack trace for fibers. Reviewed By: yfeldblum Differential Revision: D4214575 fbshipit-source-id: 4bf69e9b297c7539a2b2b71093998c30d6a2d81c
-
Lovro Puzar authored
Summary: Ubuntu 16.10 has a package for zstd 0.5.1 which is too old to be used by folly. With this change autoconf will check that one of the newer functions is present, disable zstd if not. Reviewed By: Orvid, philippv Differential Revision: D4219964 fbshipit-source-id: 1e64dfb62f81f7e61b097cb7d4fd3810da476625
-
Christopher Dykes authored
Summary: Because Windows disagrees with everything else about how to specify that you want the wildcard address. It's done with an empty string on Windows, but `nullptr` everywhere else. Reviewed By: yfeldblum Differential Revision: D4216970 fbshipit-source-id: b5dc136946d9677a96be3252e44d383a6abca800
-
- 21 Nov, 2016 3 commits
-
-
Christopher Dykes authored
Summary: The good news is that it's cleaner than it was to start with. Reviewed By: yfeldblum Differential Revision: D4215323 fbshipit-source-id: 6758092f1e76f60b360753026bb7716737a51304
-
Christopher Dykes authored
Summary: It's the only test in the file that is dependent on Subprocess, which is currently unsupported under MSVC. Reviewed By: yfeldblum Differential Revision: D4214812 fbshipit-source-id: 9dcd9763b51d037e0c452f79f134df286a11e718
-
Zach Amsden authored
Summary: Anything calling folly::init() will not link with open source build Reviewed By: yfeldblum Differential Revision: D4214296 fbshipit-source-id: 636ed5ae8ad36a323054efaad96d3756f1b7b9d0
-
- 19 Nov, 2016 6 commits
-
-
Christopher Dykes authored
Summary: Then it's time to get food. The bug report linked in the comment has more details. Reviewed By: yfeldblum Differential Revision: D4209389 fbshipit-source-id: 87e72691555992bdf964b0ded1173daadcedffa4
-
Christopher Dykes authored
Summary: Because, to the best of my knowledge, MSVC is quite right to claim it doesn't know which `dynamic` everyone keeps referring to. Is it `folly::dynamic` or `::dynamic`? Reviewed By: yfeldblum Differential Revision: D4209535 fbshipit-source-id: 63322a8f960954e1a63fe5c9a4a5d9395c7827d9
-
Christopher Dykes authored
Summary: It was including gtest directly, making MSVC unhappy. Reviewed By: yfeldblum Differential Revision: D4208744 fbshipit-source-id: 7100058f3c9fde38744888c99e927c610f11d013
-
Christopher Dykes authored
Summary: Windows automatically closes the underlying file descriptor when you call fclose, however fclose is not a function that can be easily overriden in the portability layer, so choose to just not call `close` on Windows instead. Reviewed By: yfeldblum Differential Revision: D4190524 fbshipit-source-id: a68edccd04e63f89c178ade584fa7192845773f8
-
Christopher Dykes authored
Summary: VS 2017 RC brings with it fixes for some things and unfortunately, a few known regressions in expression SFINAE. In this case, alias templates with dependent `decltype()` calls are broken, so switch to a templated struct instead. It's the very last issue mentioned in: https://blogs.msdn.microsoft.com/vcblog/2016/06/07/expression-sfinae-improvements-in-vs-2015-update-3/ Reviewed By: yfeldblum Differential Revision: D4199676 fbshipit-source-id: 9ce157cc891182509a30b000de1b509063387244
-
Maxime Boucher authored
Summary: The value of std::is_copy_assignable<folly::Synchronized<T>>::value is incorrect when T isn't copy assignable. As a result, it isn't possible to use SFINAE to properly select a function when the base type is a folly::Synchronized. This diff selectively deletes the copy constructor and copy assignment operator when the underlying type T isn't copyable. This is most useful in the case of folly::Synchronized<std::unique_ptr<...>> Reviewed By: yfeldblum Differential Revision: D4203081 fbshipit-source-id: 1e811f9e52db26c23b1c6f1907bac9e2854ddb9d
-
- 18 Nov, 2016 8 commits
-
-
Christopher Dykes authored
Summary: Because, as the comment says, MSVC fails miserably at this, producing errors at compile time. Reviewed By: yfeldblum Differential Revision: D4207544 fbshipit-source-id: d9a11b72877d22d3d3fe2e2c862d99601ab21431
-
Martin Martin authored
Summary: Expose folly::symbolizer::dumpStackTrace() for use with custom signal handlers. Reviewed By: luciang Differential Revision: D4174004 fbshipit-source-id: 510b77edef652f3e9d10f0acfb4998b64a15fad5
-
Phil Willoughby authored
Summary: Print a message to `std::cerr` when the current program is about to call `std::terminate` because a `folly::ScopeGuard` callback threw an exception. This goes to `std::terminate` in the (common) cases when the `ScopeGuard` destructor is `noexcept` This gives the user a small clue as to what just happened, since the default diagnostics for this on some platforms do not help at all. Reviewed By: nbronson Differential Revision: D4061096 fbshipit-source-id: c3b534d4a36b095e08e46f375251b6fd416ccd68
-
Nathan Bronson authored
Summary: doNotOptimizeAway's "X" input operand constraint is interpreted more loosely by gcc than by clang, resulting in surprising behavior for doNotOptimizeAway(*ptr) and a difference in behavior between gcc and clang benchmarks. clang also is more aggressive about placing an input operand into a register even when the constraint would allow it to be in memory, so an "r,m" constraint has a similar problem. This diff changes the input constraint so that register-sized values must actually be copied into a register, which makes the behavior more intuitive and more consistent across platforms. Reviewed By: davidtgoldblatt Differential Revision: D4199767 fbshipit-source-id: aa56a7b11cb3229b95da87295f0dfc38476959d2
-
Yedidya Feldblum authored
Summary: [Folly] Fix Build: `folly` with `-Wmissing-braces`. Construction of `std::array` with list-initialization for the contained C array requires double braces, per the standard. Compilers accept it with single braces, but will reject it when `-Wmissing-braces` is passed. Reviewed By: igorsugak, meyering Differential Revision: D4202629 fbshipit-source-id: e5b87a655e7f25e6cddb931dda28b172c768f227
-
Andrew Gallagher authored
Summary: These macros apply to both C and C++. Reviewed By: yfeldblum Differential Revision: D4199905 fbshipit-source-id: 8dc22959d0a6349c6c76415d1a38eda52cab83a5
-
Tom Jackson authored
Summary: Using already-available lookup table instead of a bunch of branching, this improves read throughput from ~750MB/s to 2.1GB/s in benchmarks. ``` before: (time) (rate) BM_unhexlify 1.39ns 719.26M after: BM_unhexlify 470.59ps 2.13G ``` Reviewed By: philippv Differential Revision: D4201352 fbshipit-source-id: 8393e066c45c402ccb8b537fdb25417e8e6a9511
-
Christopher Dykes authored
Summary: The standard says this shouldn't be done, but GCC, Clang, and MSVC all do, at least, MSVC does if you don't pass the `/permissive-` switch to disable this non-compliant lookup. This just qualifies it with `this->` which solves the problem. MSVC plans to eventually (some time after the 2017 release) enable `/permissive-` by default, so let's start compiling with it now. Reviewed By: yfeldblum Differential Revision: D4200725 fbshipit-source-id: 8545c6bcda9ba6006733c15f668805cb1260517a
-