- 18 Sep, 2015 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Support MSVC, which does not have VLAs, in `folly/io/async/AsyncSocket.cpp`. We use VLAs in compilers that have them, and fixed-size arrays in compilers that do not. Reviewed By: @JoelMarcey Differential Revision: D2450689
-
- 17 Sep, 2015 2 commits
-
-
Steve O'Brien authored
Summary: Instead of the default lazy-loading behavior (still the default) some singletons might need to get initialized at startup time. This would be for singletons which take a long time for the instance's constructor to run, e.g. expensive initialization by reading some large dataset, talking to an outside service, and so on. Provides a way for singletons to opt-in to this, and get populated at the time `registrationComplete()` is called, instead of lazily. Some notes about the way I implemented here, mainly, why I did this as a "builder-pattern" kind of thing and not some other way. I could probably be convinced to do otherwise. :) * Changing the constructor: the constructor's already slightly fiddly with the two optional -- well, one optional construct function, and another optional-but-only-if-construct-provided, destruct function. Didn't want to pile more into the ctor. * New superclass called `EagerLoadedSingleton`; just didn't want to add more classes, esp. if it's just to add one more option. * Method like `void setEagerLoad()` that makes this eager-load; not sure where one would write the `shouldEagerLoad()` call, probably in some central initialization spot in `main()`, but all the maintenance would have to go there. I like that it's "attached" to the singleton being defined. (Though you can still do this.) Bonus #2; the rule that builds the cpp containing "main" doesn't need to import this dependency and the cpp doesn't have to include Singleton just to do this eager-load call, nor the header for the type itself. * Omitting this altogether and just saying `folly::Singleton<Foo>::get_weak()` to "ping" the singleton and bring into existence: see last point. Still might need to have the file containing this initialization decorum include/link against Foo, as well as have one place to maintain the list of things to load up-front. Reviewed By: @meyering Differential Revision: D2449081
-
Lucian Grijincu authored
Reviewed By: @yfeldblum Differential Revision: D2446000
-
- 16 Sep, 2015 6 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Compatibility: libevent: accessors for `struct event`. Some libevent fields in `struct event` moved between `v1.4` and `v2`. Add some accessors which are defined per-libevent-version. Reviewed By: @JoelMarcey Differential Revision: D2447537
-
Lucian Grijincu authored
Summary: there's no need for this static member, but it does get generated. We're only curious about it's type. Replace with Meyer's singleton to get the same effect. Reviewed By: @ddrcoder, @yfeldblum Differential Revision: D2446131
-
Lucian Grijincu authored
Reviewed By: @elsteveogrande Differential Revision: D2446056
-
Sara Golemon authored
Summary: __m128i is only available in SSE 2 and later. We technically only use it in folly/GroupVarint.h for SSE 3+, but that's due to various other intrinsics and we could potentially lower the requirement in certain contexts, so do the right thing in the generated table. Revisit the uses in folly/GroupVarint.h later. Reviewed By: @yfeldblum Differential Revision: D2445798
-
James Sedgwick authored
Summary: For the perfs - big improvement on one fd per timeout. Reviewed By: @djwatson, @fugalh Differential Revision: D2379210
-
Lucian Grijincu authored
Reviewed By: @yfeldblum Differential Revision: D2446538
-
- 15 Sep, 2015 5 commits
-
-
Lucian Grijincu authored
Summary: avoid sillyness: ``` $ _build/opt/folly/io/async/test/async_test --gtest_list_tests ASAN:SIGSEGV ================================================================= ==3245135==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x000000583444 sp 0x7fff17ba0c40 bp 0x7fff17ba0c80 T0) #0 0x583443 in std::_Rb_tree<int, std::pair<int const, folly::SSLContext::SSLLockType>, std::_Select1st<std::pair<int const, folly::SSLContext::SSLLockType> >, std::less<int>, std::allocator<std::pair<int const, folly::SSLContext::SSLLockType> > >::operator=(std::_Rb_tree<int, std::pair<int const, folly::SSLContext::SSLLockType>, std::_Select1st<std::pair<int const, folly::SSLContext::SSLLockType> >, std::less<int>, std::allocator<std::pair<int const, folly::SSLContext::SSLLockType> > > const&) third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/bits/stl_tree.h:1138 #1 0x583443 in std::map<int, folly::SSLContext::SSLLockType, std::less<int>, std::allocator<std::pair<int const, folly::SSLContext::SSLLockType> > >::operator=(std::map<int, folly::SSLContext::SSLLockType, std::less<int>, std::allocator<std::pair<int const, folly::SSLContext::SSLLockType> > > const&) third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/bits/stl_map.h:295 #2 0x583443 in folly::SSLContext::setSSLLockTypes(std::map<int, folly::SSLContext::SSLLockType, std::less<int>, std::allocator<std::pair<int const, folly::SSLContext::SSLLockType> > >) folly/io/async/SSLContext.cpp:682 #3 0x40e028 in Initializer folly/io/async/test/AsyncSSLSocketTest2.cpp:143 #4 0x40e028 in __static_initialization_and_destruction_0 folly/io/async/test/AsyncSSLSocketTest2.cpp:146 #5 0x40e028 in _GLOBAL__sub_I__ZN5folly47AsyncSSLSocketTest2_AttachDetachSSLContext_Test10test_info_E folly/io/async/test/AsyncSSLSocketTest2.cpp:147 #6 0x66cf2e in __libc_csu_init /home/engshare/third-party2/glibc/2.20/src/glibc-2.20/csu/elf-init.c:88 #7 0x7f7145600084 in __libc_start_main (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libc.so.6+0x20084) #8 0x410be5 (/data/users/lucian/fbcode2/_build/opt/folly/io/async/test/async_test+0x410be5) AddressSanitizer can not provide additional info. AAAAAAASUMMARY: AddressSanitizer: SEGV third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/bits/stl_tree.h:1138 std::_Rb_tree<int, std::pair<int const, folly::SSLContext::SSLLockType>, std::_Select1st<std::pair<int const, folly::SSLContext::SSLLockType> >, std::less<int>, std::allocator<std::pair<int const, folly::SSLContext::SSLLockType> > >::operator=(std::_Rb_tree<int, std::pair<int const, folly::SSLContext::SSLLockType>, std::_Select1st<std::pair<int const, folly::SSLContext::SSLLockType> >, std::less<int>, std::allocator<std::pair<int const, folly::SSLContext::SSLLockType> > > const&) ==3245135==ABORTING ``` Reviewed By: @philippv Differential Revision: D2440796
-
Kevin Hurley authored
Summary: Forgot to add a test for this when I added update_missing. This adds a test for it Reviewed By: @yfeldblum Differential Revision: D2441612
-
Yedidya Feldblum authored
Summary: [Folly] Prefer `constexpr` to preprocessor macros in `FBString.h`. Reviewed By: @JoelMarcey Differential Revision: D2441709
-
Yedidya Feldblum authored
Summary: [Folly] No need to export global instances of `folly::AsciiCaseInsensitive` and `folly::AsciiCaseSensitive`. Calling code may simply construct instances at will - the compiler will optimize away the object construction since it has only the default ctor/dtor, no storage, and no vtable. Reviewed By: @fugalh Differential Revision: D2437419
-
Yedidya Feldblum authored
Summary: [Folly] Drop support for GCC < 4.8 in `folly/FBString.h`. Can't stay indefinitely backcompat with older compilers. Reviewed By: @JoelMarcey Differential Revision: D2441747
-
- 14 Sep, 2015 10 commits
-
-
Orvid King authored
Summary: Because the windows version of pthread very definitely does not implement the clock. The Cygwin and MinGW headers might, so let them still fall back to the pthread includes. Closes https://github.com/facebook/folly/pull/280 Reviewed By: @yfeldblum Differential Revision: D2419067 Pulled By: @JoelMarcey
-
Giuseppe Ottaviano authored
Summary: `Final` is idempotent, no reason for it not to be `const`. Checked with a benchmark that the new version does not affect performance. Reviewed By: @yfeldblum Differential Revision: D2397377
-
Yedidya Feldblum authored
Summary: [Folly] CodeMod: Drop `FOLLY_OVERRIDE` and `FOLLY_FINAL`. These were to support GCC 4.6 and earlier, and MSVC 2008 and earlier. Reviewed By: @philippv Differential Revision: D2438309
-
Yedidya Feldblum authored
Summary: [Folly] Lift the test for `<ext/random>` and `__gnu_cxx::sfmt19937`. Put an actual check in `folly/configure.ac` and use the result in `folly/Random.h`. Reviewed By: @Gownta Differential Revision: D2438420
-
Orvid King authored
Summary: MSVC 2015 supports constexpr intrinsics, and, as the GCC builtins are implemented by #287, we can remove all the MSVC specific intrinsic stuff that isn't constexpr supported. Closes https://github.com/facebook/folly/pull/288 Reviewed By: @yfeldblum Differential Revision: D2419064 Pulled By: @JoelMarcey
-
Orvid King authored
Summary: MSVC doesn't like it when you use `%1$s`, and actually emits a warning at compile time, so pass the second arugment twice instead. Closes https://github.com/facebook/folly/pull/302 Reviewed By: @yfeldblum Differential Revision: D2371262 Pulled By: @JoelMarcey
-
Christopher Cole authored
Summary: There's 2 ways this could be implemented - either as a series of preprocessor blocks depending on target architecture (as I have implemented it here), or by encapsulating access to MediumLarge::capacity_ within getters/setters as in a similar manner to setSmallSize() and smallSize(). The first option makes the code a bit harder to read, but the second option changes the existing control flow a bit which could slightly alter performance. I opted for the first so as to keep the existing amd64 flow untouched, but can easily change the pull request to the second option to keep code readability a priority. Closes https://github.com/facebook/folly/pull/244 Reviewed By: @Gownta Differential Revision: D2306568 Pulled By: @JoelMarcey
-
Orvid King authored
Summary: Winsock's structures don't have a member named `s6_addr16`, so use the name for Winsock's structure. Closes https://github.com/facebook/folly/pull/279 Reviewed By: @yfeldblum Differential Revision: D2284223 Pulled By: @JoelMarcey
-
Yedidya Feldblum authored
Summary: [Folly] Support `unique_ptr` instances with custom deleters in `to_shared_ptr`. We now support `unique_ptr<T, D>` rather than just `unique_ptr<T>`. Reviewed By: @lbrandy Differential Revision: D2438217
-
Yedidya Feldblum authored
Summary: [Folly] The ' in `folly/configure.ac` messes with Vim's highlighting. Reviewed By: @JoelMarcey Differential Revision: D2438280
-
- 13 Sep, 2015 3 commits
-
-
Orvid King authored
Summary: Because .native() produces a wstring under MSVC. Closes #306 Reviewed By: @yfeldblum Differential Revision: D2419043 Pulled By: @JoelMarcey
-
Yedidya Feldblum authored
Summary: [Folly] Drop support for GCC < 4.8 in folly/experimental/Bits.h Can't stay indefinitely backcompat with older compilers. Reviewed By: @meyering Differential Revision: D2420133
-
Leonardo Bianconi authored
Summary: This patch adds PPC64 specific code in order to support this architecture and be able to be used by HHVM. Closes #299 Reviewed By: @simpkins Differential Revision: D2340723 Pulled By: @JoelMarcey
-
- 12 Sep, 2015 1 commit
-
-
Giuseppe Ottaviano authored
Reviewed By: @liviu Differential Revision: D2436705
-
- 11 Sep, 2015 7 commits
-
-
Bryce Redd authored
Summary: The capacity variable changed types, and turn function needed an explicit cast. Reviewed By: @BurntBrunch Differential Revision: D2421421
-
Kevin Hurley authored
Summary: Adding ability to merge dynamic objects with another object. It will just overwrite duplicate keys Reviewed By: @yfeldblum Differential Revision: D2413628
-
Maxim Georgiev authored
Summary: folly::AsyncSSLSocket class has a number of "get..." methods which don't change the object's state, but are not marked as "const". As a result these methods can't be called on objects passed through const pointer or referrence. Adding "const" modificator for these methods. Reviewed By: @yfeldblum Differential Revision: D2430134
-
Sara Golemon authored
This reverts commit 6caa3d95.
-
Lucian Grijincu authored
Reviewed By: @yfeldblum Differential Revision: D2433146
-
Yedidya Feldblum authored
Summary: [Folly] Use type-parameterized test cases in `folly/test/SynchronizedTest.cpp`. And some cleanups. Reviewed By: @nbronson Differential Revision: D2428287
-
Yedidya Feldblum authored
Summary: [Folly] Fix Build: IPv6: `SocketAddressTest.SetFromStrings` and `AsyncSocketTest.ConnectTimeout` failing On IPv6-only machines, the `SocketAddressTest.SetFromStrings` example in `folly/test/SocketAddressTest.cpp` was failing because it tries to resolve `127.0.0.1` with `AI_ADDRCONFIG` set. Fix it by detecting which of IPv6 and IPv4 are enabled, and picking an appropriate loopback address. On IPv6-only machines, the `AsyncSocketTest.ConnectTimeout` example in `folly/io/async/test/AsyncSocketTest2.cpp` was failing because it tries to connect `8.8.8.8`, which is IPv4. Fix it by detecting which of IPv6 and IPv4 are enabled, and picking an approprate remote address. Reviewed By: @chipturner Differential Revision: D2429109
-
- 10 Sep, 2015 4 commits
-
-
Mark McDuff authored
Summary: Exit synchronization is the worst! The worst! Reviewed By: @bmaurer Differential Revision: D2253073
-
Giuseppe Ottaviano authored
Summary: This diff introduces a few breaking API changes to both EliasFanoReader and BitVectorReader in order to fix some inconsistencies: - As initalized, `EliasFanoReader` and `BitVectorReader` held a value of `0`, thus if `0` is present in the list `skipTo(0)` would not update the position to `0`, as it happens with any other `skipTo(<first element>)`. This fixes `jumpTo` accordingly. - `jump(i + 1)` would go at position `i`. Now `reader.jump(i)`'s postcondition is `reader.position() == i`. - It is now illegal to retrieve `value()` from a reader in an out-of-bounds position (before-the-begin or past-the-end). Validity of a reader can be checked with `valid()`. Reviewed By: @philippv Differential Revision: D2420023
-
Elliott Clark authored
Summary: Promise<T> has isFulFilled. This patch adds the corresponding functionality to shared promise. Reviewed By: @jsedgwick Differential Revision: D2417631
-
Lucian Grijincu authored
Summary: This works: std::vector<T*> v; std::vector<std::unique_ptr<T>> uv(v.begin(), v.end()) Make it work for small_vector as well. Reviewed By: @ot, @Gownta Differential Revision: D2426919
-
- 09 Sep, 2015 1 commit
-
-
Eugene Pekurovsky authored
Summary: 1) Added uniform interval distribution functionality. 2) Added a generic API for custom interval distribution algorithms. 3) Fixed an issue with removing a canceled function. 4) Did some code cleanup along the way. Reviewed By: @kaanb Differential Revision: D2339911
-