- 28 Sep, 2015 2 commits
-
-
Ben Maurer authored
Summary: sorry Reviewed By: @chiunlin Differential Revision: D2485925
-
Ben Maurer authored
Summary: These classes are likely to be used as static variables and can easily be constructed with constexpr. One that we really ought to fix is SpinLock. Sadly we have a bunch of implementations of it some of which need initialization. Reviewed By: @meyering Differential Revision: D2459355
-
- 25 Sep, 2015 1 commit
-
-
Steve O'Brien authored
Summary: * `registrationComplete` has a slightly different interface (uses enums now) * `void doEagerInit()` method initializes synchronously; `Future<Unit> doEagerInitVia(Executor*)` now available. Reviewed By: @luciang, @meyering Differential Revision: D2463464
-
- 24 Sep, 2015 3 commits
-
-
Justin Gibbs authored
Summary: Allow objects that only support in-place construction (no copy/move constructor) to be stored in AtomicHashMap and AtomicHashArray via the emplace() method. This uses variadic template parameters and perfect forwarding to allow the arguments for any valid constructor for the object to be used during insertion. Reviewed By: @nbronson Differential Revision: D2458152
-
Yedidya Feldblum authored
Summary: [Folly] A `qfind_first_byte_of` using a `bitset` in `folly/Range.cpp`. With additions to the existing benchmark program. Reviewed By: @nbronson Differential Revision: D2465890
-
James Sedgwick authored
Summary: This broke EventBase tests, which I managed not to run because they're marked as extended for some reason :( I don't have time to take another stab at this at the moment so I'm reverting for now Reviewed By: @djwatson Differential Revision: D2467789
-
- 23 Sep, 2015 3 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] `CpuIdTest.cpp` does not need `glog`. Reviewed By: @@philippv Differential Revision: D2470503
-
Yedidya Feldblum authored
Summary: [Folly] Search unpadded strings in `Range` benchmarks. `vstr` has padding to adjust alignment. `vstrp` is a view into `vstr` that skips the padding, so that searches start out unaligned. Before this diff, haystack is 8-byte aligned: `uintptr_t(haystack.begin()) % 8 == 0`. After this diff, it is not. Reviewed By: @@nbronson Differential Revision: D2468934
-
Yedidya Feldblum authored
Summary: [Folly] Use constexpr for folly::dynamic::TypeInfo static fields These things are compile-time values. So yeah. Reviewed By: @@JoelMarcey Differential Revision: D2466270
-
- 22 Sep, 2015 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Fully clean up before each round of benchmarks in `RangeFindBenchmark.cpp`. The `vstr` and `vstrp` globals need to be cleaned up before each round of benchmarks. Reviewed By: @@nbronson Differential Revision: D2467254
-
- 21 Sep, 2015 4 commits
-
-
Chip Turner authored
Summary: Looks like some platforms fail to build (open source, not internal) due to #if conditional. Reviewed By: @ldemailly Differential Revision: D2464555
-
Subodh Iyengar authored
Summary: There is a potential double free in destructor guard if someone calls a method which takes a DG in the destructor of the DG. This is potential in the case when someone is holding onto a DG while calling destroy() on the object. Reviewed By: @djwatson Differential Revision: D2463113
-
Chip Turner authored
Summary: strncpy is bad. strlcpy is somewhat less bad. We already had this function, but let's move it somewhere more reasonable. This would make sense to live in String.h, but then we have circular dependencies. Since String.h includes Demangle.h, though, you get strlcpy by including it, so this should be okay enough. Reviewed By: @lbrandy Differential Revision: D2097590
-
Marc Horowitz authored
Summary: to<bool>(42) should return true, not throw an exception. Reviewed By: @yfeldblum Differential Revision: D2459766
-
- 20 Sep, 2015 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Use string for benchmark names to support computed names. A benchmark program might call `folly::addBenchmark` with a computed benchmark name without wishing to maintain the lifetime of the string. Support this case. Reviewed By: @philippv Differential Revision: D2460621
-
- 19 Sep, 2015 1 commit
-
-
Philip Pronin authored
Summary: Semantics matches `Arena<>::totalSize()`. Reviewed By: @luciang, @ot Differential Revision: D2456388
-
- 18 Sep, 2015 2 commits
-
-
James Sedgwick authored
Summary: This can be useful on its own, will use in twagent Reviewed By: @fugalh Differential Revision: D2457778
-
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 9 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
-