- 17 Apr, 2017 1 commit
-
-
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 15 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
-
Christopher Dykes authored
Summary: Because, soon it won't be required. Reviewed By: yfeldblum Differential Revision: D4892076 fbshipit-source-id: 6bfbf5bf523262659c0af336f659398ae8545e50
-
Christopher Dykes authored
Summary: They aren't actually needed as the primary implementation is supported on all platforms. Reviewed By: yfeldblum Differential Revision: D4882687 fbshipit-source-id: 7208c5d3c1f35b29b0cabb6a20fe030fbf10b131
-
Mark Williams authored
Summary: This reverts commit 9574ea984e1e3daca01101259687f46effcf3a9f Differential Revision: D4805628 fbshipit-source-id: 3285317a4c3f2012da1f13e9c91b6c623726c9b7
-
Yedidya Feldblum authored
Summary: Initialize the singleton-vault early in `init()` to avoid ordering problems with other parts of `init()`. Initialization is done by calling `SingletonVault::singleton()->registrationComplete()`. Do that before (almost) everything, in particular, before parsing args and initializing logging. Note that this just marks it okay for singletons to be instantiated, but does not by itself instantiate any singletons. However, this is useful if, in some way, parsing args or initializing logging should happen to use singletons. Reviewed By: andriigrynenko Differential Revision: D4889777 fbshipit-source-id: 6817db22d38a498cd20e361fc574a146029432ec
-
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. - Cast to signed types to perform integral negation before casting back to unsigned for bit operations. - Enable a simpler overload for bool->float conversion than one which attempts float->bool. - Delete one unneeded undef. (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum Differential Revision: D4805628 fbshipit-source-id: 9574ea984e1e3daca01101259687f46effcf3a9f
-
Andrew Krieger authored
Summary: For getting a thread id for hashing, std::this_thread::get_id() is just as good and also removes an unneeded pthreads dependency. This enables using MPMCQueue on Windows without pthreads as well. Reviewed By: Orvid, yfeldblum Differential Revision: D4879940 fbshipit-source-id: c4fb5eea165eb450240f94904aa26a10aa394d1b
-
Christopher Dykes authored
Summary: As titled. There are some places where scoping prevents trivial conversion, so I've left those places with explicit lock/unlock calls. Reviewed By: andriigrynenko, yfeldblum Differential Revision: D4888812 fbshipit-source-id: c124306e0373ee9eb395cb98f88df63c91523d48
-
Christopher Dykes authored
Summary: Ignoring the questionability of the approach it's being used in, it's better to not have the direct PThread dependency. Reviewed By: yfeldblum Differential Revision: D4889245 fbshipit-source-id: da099c6f938dbe98c1b9eeaf4de0a27a2c4d65f1
-
Andrew Krieger authored
Summary: In Unicode enabled projects, this errors because CreateFile aliases CreateFileW, which takes wchar_t* not char*. Reviewed By: Orvid, yfeldblum Differential Revision: D4878424 fbshipit-source-id: b44b369c0533e74163f68d95c2bf353584033731
-
Christopher Dykes authored
Summary: Just use the native Windows API call instead, as it gives the same result. Reviewed By: yfeldblum Differential Revision: D4887587 fbshipit-source-id: adbfd288bea425f1aff46d0685083807490f7f09
-
Christopher Dykes authored
Summary: `TimedMutex` was already using `folly::SpinLock`, so switch `TimedRWMutex` to do the same. Reviewed By: andriigrynenko Differential Revision: D4888005 fbshipit-source-id: 6e782347bc22dc186ed41f2e77c6614b8444bae2
-
- 13 Apr, 2017 7 commits
-
-
Christopher Dykes authored
Summary: As part of the work towards getting Folly compiling without PThread, it needs to be treated as a non-portable include. This switches the includes not already covered by other diffs. Reviewed By: yfeldblum Differential Revision: D4882777 fbshipit-source-id: d9521564c814f9bcff2fcb358cbb89b3777c327d
-
Christopher Dykes authored
Summary: MSVC didn't like referring to members of `exception_wrapper` in the initializer for a `static constexpr` field directly in `exception_wrapper`, so shift the initialization to the actual definition of the fields. As the fields are only referred to via their address, dropping the `constexpr` loses nothing. Reviewed By: ericniebler Differential Revision: D4873939 fbshipit-source-id: 30b690b1ab3f2f7a25b9dc4863b46f64c811797d
-
Neel Goyal authored
Summary: Add a method where users can determine if a SSL lock is disabled. This can help when it comes to making decisions about things like whether reusing SSL Contexts is safe in multithreaded programs. Reviewed By: siyengar Differential Revision: D4875780 fbshipit-source-id: 91e9259fee25856be1b77823559d16d0679bde5b
-
Christopher Dykes authored
Summary: They aren't actually needed, and are in the way of being able to build Folly without PThread. Reviewed By: yfeldblum Differential Revision: D4882410 fbshipit-source-id: e4a48600f79c57bb965a35fab94962a29b8e06d4
-
Christopher Dykes authored
Summary: This is for use on Windows only, and does not support Linux or OSX in the slightest. There are probably still a few hacks laying around in it, but it works, and that's good enough for now. Reviewed By: yfeldblum Differential Revision: D4873498 fbshipit-source-id: 5952a927037dc1d56c51e71d51ba506d2cd17357
-
Nick Terrell authored
Summary: Adds bzip2 support to `folly/io/Compression.h`. Adds bzip2 to the default set of supported codecs for the `AutomaticCodec`. Reviewed By: yfeldblum Differential Revision: D4873771 fbshipit-source-id: d4f4861aef7e4b9efb67095e8892c265b5ae5557
-
Christopher Dykes authored
Summary: Well, MSVC 2017 anyways. MSVC 2017 wasn't able to handle the decltype in the type specialization, which was also entirely unnecesary. Reviewed By: yfeldblum Differential Revision: D4880272 fbshipit-source-id: b6deed72a12d4b58d6eca200e7287e536f94ca30
-
- 12 Apr, 2017 9 commits
-
-
Alexey Spiridonov authored
Summary: This is a bit too magical -- it's not clear that the thing produces an Options object. If you do know that you can chain further option setters off this thing, it's nice, but otherwise, the first impression is "what just happened?". So, let's have one good way for doing things. Reviewed By: yfeldblum Differential Revision: D4863947 fbshipit-source-id: 3dfe83cfc077d47f604f47dcb21149fbaa2d2243
-
Alexey Spiridonov authored
Summary: This operator is WRONG. It has not worked correctly for years, e.g. it lacks support for chdir, and several other options. The operator is not really useful after C++11. Usually, you should just chain setters, e.g. `Subprocess::Options().pipeStdout().pipeStderr()`. If you must repeatedly mutate options in a fixed way, in the C++11 world you can use a lambda instead. Reviewed By: yfeldblum Differential Revision: D4862698 fbshipit-source-id: a2d8ace53424b9232e178cf202cf51beb7b59b12
-
Nick Terrell authored
Summary: Since IOBuf rounds to a good malloc size, zlib and lzma waste space. For a 4 MiB `length`, about 1 MiB of the IOBuf is wasted. Reviewed By: yfeldblum Differential Revision: D4872830 fbshipit-source-id: 42fc83277b2dae22b75403e0e71c43e8f2b19f21
-
Jude Taylor authored
Reviewed By: anirudhvr Differential Revision: D4830205 fbshipit-source-id: 55f34c3bddead8a73174c403f76572248c541a10
-
Christopher Dykes authored
Summary: Template pack expansion plays much nicer when being expanded into the template parameters of a base class than it does as the template parameters to a templated `using` when under MSVC. This fixes the other half of `folly::exception_wrapper`. Reviewed By: yfeldblum Differential Revision: D4874047 fbshipit-source-id: 6593d10f8737b940bd550353e54f43bc96402a48
-
Jude Taylor authored
Summary: opensource changes for t16702532 Reviewed By: yfeldblum Differential Revision: D4846899 fbshipit-source-id: 67a610ff399e95c7cf1c9c8a5950f79bfc3aabb9
-
Artem Lantsev authored
Summary: This is a follow up commit for the thread https://github.com/facebook/folly/pull/378 Reviewed By: nbronson Differential Revision: D4860356 fbshipit-source-id: f10a0d12a593c18b1abf94da5b477c524c04f4be
-
Aravind Anbudurai authored
Summary: This diffs adds supports on folly::Subprocess to be able to take clone flags and use them to call clone(2) instead of the default vfork() I checked that all tests pass when I replace vfork with fork on trunk. So there isn't anything built assuming the parent is paused for an execve. Correct me if I am wrong here. (Note: this ignores all push blocking failures!) Reviewed By: snarkmaster Differential Revision: D4853169 fbshipit-source-id: 7e5851df3a49996a4a5dc1945457686dd042e1f4
-
Angelo Failla authored
Summary: As per the title, this adds methods to convert IPv(46) to their inverse representation, this is useful for applications that needs to calculate the inverse arpa representation, typically used when making PTR DNS requests. Reviewed By: Orvid Differential Revision: D4867502 fbshipit-source-id: 190e5c309b17a633e1c97b077f212ab38725860f
-
- 11 Apr, 2017 3 commits
-
-
Eric Niebler authored
Summary: The purpose of this reimplementation of `exception_wrapper` is threefold: - Make `exception_wrapper` smaller. It goes from 48 bytes to 24. - Give it `noexcept` ~~copy and~~ move - Store small exception objects in an internal buffer; i.e., with zero allocations. The ultimate goal is to change `folly::Try<T>` to a thin wrapper over `folly::Expected<T, exception_wrapper>`. (Currently, it stores the `exception_wrapper` on the heap.) As part of this redesign, I: - Remove `exception_wrapper::getCopied`. The user shouldn't care how the `exception_wrapper` stores the exception. - Remove `exception_wrapper::operator==`. It was only used in 2 places in test code. The existing semantics (return true IFF two `exception_wrapper`s point to the //same// exception object) prevented the small-object optimization. - Add new `handle()` API that behaves like cascading `catch` clauses. For instance: ```lang=c++ exception_wrapper ew = ...; ew.handle( [&](const SomeException& e) { /*...*/ }, [&](const AnotherException& e) { /*...*/ }, [&](...) { /* catch all*/ }, // yes, lambda with ellipses works! ``` - Add a `type()` member for accessing the `typeid` of the wrapped exception, if it's known or can be determined with a `catch(std::exception&)`. This table shows the percent improvement for the exception_wrapper_benchmark test: | Test | Percent improvement (gcc-5) | Percent improvement (gcc-4) | ----- | ----- | ----- | exception_wrapper_create_and_test | 14.33% | -6.50% | exception_wrapper_create_and_test_concurrent | 11.91% | 20.15% | exception_wrapper_create_and_throw | -0.82% | -0.25% | exception_wrapper_create_and_cast | 15.02% | 14.31% | exception_wrapper_create_and_throw_concurrent | 18.37% | 8.03% | exception_wrapper_create_and_cast_concurrent | 28.18% | -10.77% The percent win for gcc-5 is 15% on average. The non-throwing tests show a greater win since the cost of actually throwing an exception drowns out the other improvements. (One of the reasons to use `exception_wrapper` is to not need to throw in the first place.) On gcc-4, there is roughly no change since the gcc-4 standard exceptions (`std::runtime_error`, std::logic_error`) are non-conforming since they have throwing copy operations. Reviewed By: yfeldblum Differential Revision: D4385822 fbshipit-source-id: 63a8316c2923b29a79f8fa446126a8c37aa32989
-
Christopher Dykes authored
Summary: On Windows, the OpenSSL headers have to be included in a specific order relative to WinSock. Fixing the issues ad-hock is not a viable way to continue, so treat it as completely non-portable and require all includes of it in Folly to go through the portability header. Reviewed By: yfeldblum Differential Revision: D4856858 fbshipit-source-id: 56aca1fb0fe095f41a8af12488c6c2080344603d
-
Christopher Dykes authored
Summary: It doesn't exist on OSX or Windows, so implement it. Closes https://github.com/facebook/folly/issues/567 Reviewed By: yfeldblum Differential Revision: D4783463 fbshipit-source-id: 0a2586aced7123b797a8e55a3e86124b449634e4
-