- 19 Nov, 2017 2 commits
-
-
Adam Simpkins authored
Summary: Add folly::to() conversions to convert between std::chrono::duration or std::chrono::time_point types and struct timespec or struct timeval types. To conform to the behavior of the existing arithmetic-to-arithmetic conversions, this code performs proper overflow checking and throws a `ConversionError` on overflow. This unfortunately does make the code rather complicated compared to a non-checking implementation. Conversions between some unusual duration types is not implemented yet, and will fail at compile time if someone tries to use it. This happens for durations where neither the numerator nor the denominator of the ratio is 1. For instance, 7/13ths of a second. Reviewed By: yfeldblum Differential Revision: D6356700 fbshipit-source-id: 9dce8ab8f32d8c18089f32c7176a8abf3c3f11f7
-
Pingjia Shan authored
Summary: In the past, these calls were required. Used to solve static destruction ordering issue. Any static object that uses RequestContext must call this function in its constructor. That is when we were using `static folly::ThreadLocal<std::shared_ptr<RequestContext>>`, which was non-leaky. The problem being addressed is when we have some code of the form: ```lang=c++ void doWork() { static EventBase eb; } ``` But now we are using `SingletonThreadLocal<std::shared_ptr<RequestContext>>`, which is leaky. So the issue that these calls were there to address seems to have been resolved. Reviewed By: yfeldblum Differential Revision: D6332597 fbshipit-source-id: c6aba6620ef2fb3a344ea20f56c8b9c0cdf42c70
-
- 18 Nov, 2017 2 commits
-
-
Pádraig Brady authored
Summary: This is required to avoid new GCC 7 -Wimplict-fallthrough warnings. We also update to use the C++17 [[fallthrough]] attribute if supported. Reviewed By: yfeldblum Differential Revision: D6367140 fbshipit-source-id: d5380983cb300f944df9c2885d0faa0155994be7
-
Tianjiao Yin authored
Summary: This unit-test takes too long to finish in ASAN mode from heavily loaded system (more than 10 minutes). Reviewed By: yfeldblum Differential Revision: D6362111 fbshipit-source-id: b097eff60f88ace4fb869132598806700804e267
-
- 17 Nov, 2017 2 commits
-
-
Pingjia Shan authored
Summary: Seems to be causing rendering error: {F114885894} Created from Diffusion's 'Open in Editor' feature. Reviewed By: lskuff Differential Revision: D6358188 fbshipit-source-id: 3c437007b425bcadb79a71807ad92d520a70e8cb
-
Jim Meyering authored
Summary: With ASAN enabled (actually, only with ASAN *and* its detect_stack_use_after_return=1 option), the addTaskFinally test would fail. This adapts to accommodate the larger stack offsets. Also, use EXPECT_GT and EXPECT_LT rather than EXPECT_TRUE. Reviewed By: yfeldblum Differential Revision: D6353666 fbshipit-source-id: 39e04caffa7b24cde97c749686c7e651a071dcec
-
- 16 Nov, 2017 2 commits
-
-
Jody Ho authored
Summary: We would like to know the time remaining for a scheduled timeout to decide whether a new event should override the scheduled timeout. Reviewed By: yfeldblum Differential Revision: D6334067 fbshipit-source-id: f172d5cd7fc804db5fd53a42d06cadfddf857e22
-
Subodh Iyengar authored
Summary: Add unit test for immediate timeout since we're using it in a few places. Reviewed By: yfeldblum Differential Revision: D6327012 fbshipit-source-id: ea80763d080b06e2a43277118d3147dc8016f348
-
- 15 Nov, 2017 5 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Fix wrong source name in tests `Makefile.am`. Closes #714. Reviewed By: Orvid Differential Revision: D6340209 fbshipit-source-id: 88da57fb4d663071eb578efec50c7e162b0c03d1
-
Benny Chen authored
Summary: this is to allow small_vector to be a storage option for sorted_vector_map. Reas on I want to do this is because in ads there are a lot of small maps where we wo uld have to allocate separately. Reviewed By: yfeldblum Differential Revision: D6318811 fbshipit-source-id: b145d1bef2cbbeb946995aa66b55aaadeb6c54f5
-
Adam Simpkins authored
Summary: Add EXPECT_THROW_RE() and EXPECT_THROW_ERRNO() macros to folly/test/TestUtils.h These allow more precise checks than the basic EXPECT_THROW() macro provided as part of gtest. These macros are being moved into folly from Facebook's eden repository (https://github.com/facebookexperimental/eden) This will allow us to use them in folly tests and in other projects that depend on folly. Reviewed By: yfeldblum Differential Revision: D6301760 fbshipit-source-id: 1f434fb5bc9b7859f763171264fb0b2e1b4bda62
-
Igor Sugak authored
Reviewed By: yfeldblum Differential Revision: D6332075 fbshipit-source-id: 26a279b6ee4253a8be8f9f63e6900c2082a5486d
-
Yedidya Feldblum authored
Summary: [Folly] Extra expectations for ADL `toAppend`. Reviewed By: Orvid Differential Revision: D6330547 fbshipit-source-id: d1363280f097f860883ba84d6cfe7caa4e4cf9de
-
- 14 Nov, 2017 1 commit
-
-
Christopher Dykes authored
Summary: The commands as they were previously would attempt to install Folly as 32-bit, which would fail. Also removes an extra `-` in the link's url. Closes: https://github.com/facebook/folly/issues/713 Reviewed By: yfeldblum Differential Revision: D6327981 fbshipit-source-id: ced8c86948b8be5c1dd88e14d6c3a77fc783aac9
-
- 13 Nov, 2017 1 commit
-
-
Jason Fried authored
Summary: Moving the cython definition to folly/python. Adding simple conversion helper to_bytes This is to cut down on duplicate folly::range cython definitions Reviewed By: yfeldblum Differential Revision: D6291125 fbshipit-source-id: 314b732a1516a03fb5c9a57939552bbabd81970b
-
- 12 Nov, 2017 2 commits
-
-
Andrew Krieger authored
Summary: Similar to https://github.com/facebook/folly/commit/29ffcc50981fd50dd2ab1a69f8a262c4b7c27ad4, (D6254219), this was manifesting as random ICEs that repro consistently in a given file on a given machine, but in different files for different machines and sometimes not at all. Reviewed By: Orvid, yfeldblum Differential Revision: D6303186 fbshipit-source-id: d91ad633352fc5c28640e71fd1539f6a4ba8f70f
-
Yedidya Feldblum authored
Summary: [Folly] Fix some declared tests not being included in `Makefile` `TESTS` list. Reviewed By: pixelb Differential Revision: D6307755 fbshipit-source-id: 8853d8fce25768ff17f9b1e53b1fbba0aa213691
-
- 11 Nov, 2017 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] Backport C++17 container access functions: `size`, `empty`, `data`. Reviewed By: Orvid Differential Revision: D6301986 fbshipit-source-id: 65c31df68b7743d5ed4a2cf2419586b862683c48
-
- 10 Nov, 2017 5 commits
-
-
Sergey Doroshenko authored
Summary: (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum Differential Revision: D6299313 fbshipit-source-id: 95be2339f4845502e3c446698e54643eeac8055f
-
Christopher Dykes authored
Summary: Tweak the wording of a couple error messages to make them clearer. Also disable the 'digraphs not supported' warning, as none of our supported compilers actually interpret digraphs in any of our supported build configurations. Closes: https://github.com/facebook/folly/issues/706 Reviewed By: yfeldblum Differential Revision: D6299715 fbshipit-source-id: 7c847ac859e082aea711f6751f626b4b43886da4
-
Pádraig Brady authored
Summary: When __NR_membarrier is defined (on newer kernels), we don't define the constants, but also by default don't include the membarrier header to define the necessary constants. Therefore split the definition of the syscall value and the constants used with it, to ensure both are defined. Reviewed By: yfeldblum Differential Revision: D6292178 fbshipit-source-id: 31ba9d4a698a4f5e14ae34de0acf8f851d75527d
-
Pádraig Brady authored
Summary: With gcc 7.2 we get the warning: folly/io/async/DelayedDestructionBase.h:252:20: error: parameter ‘right’ set but not used [-Werror=unused-but-set-parameter] std::nullptr_t right) { ^~~~~ I presume this is due to the implicit conversion, hence the named parameter is never assigned. Instead we use an explicit nullptr. Reviewed By: yfeldblum Differential Revision: D6279302 fbshipit-source-id: ed449601b0410c178777f20e82ed09d9097bd024
-
Shubhanshu Agrawal authored
Summary: The current folly::once_flag is not compatible with folly fibers and when using it with fibers is inefficient and also cause deadlocks. This diff makes the once flag's mutex be a templatable paramter and overrides it in fibers library with a fiber compatible mtuex. Reviewed By: yfeldblum Differential Revision: D6288508 fbshipit-source-id: 6f82e1794d1f417f8d267061f1702a26a7b4ff12
-
- 09 Nov, 2017 10 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Add `makeSemiFuture` declarations to `helpers.h`. For consistency with the `makeFuture` declarations that are also there. Definitions for both are found in `Future-inl.h`. Reviewed By: LeeHowes Differential Revision: D6281826 fbshipit-source-id: 4b22dd9086d05dbdebba358c6f569a772017949a
-
Phil Willoughby authored
Summary: Some older versions of GCC/glibc/etc do not have the std::is_trivially*_constructible or std::is_trivially*_assignable traits. Reviewed By: yfeldblum Differential Revision: D6285887 fbshipit-source-id: 1eb4ae4f899dc1f528321f9f087390291687aca3
-
Dan Melnic authored
Summary: Remove the zerocopy write threshold support since it is a little bit confusing Reviewed By: djwatson Differential Revision: D6256854 fbshipit-source-id: 1c992f93d7b04c4ede2fbefebde7a7ae89de3764
-
Teng Qin authored
Summary: Currently `folly::symbolizer`'s `getDefinitionByAddress` and `getSymbolByName` only parses `STT_OBJECT` and `STT_FUNC`. There are some standar library functions that uses the GNU indirect function feature that would have been missed: ==== For libpthread-2.23.so: ====== Symbol system Addr 119d0 Size 8 is a STT_GNU_IFUNC ====== Symbol siglongjmp Addr 10700 Size 8 is a STT_GNU_IFUNC ====== Symbol longjmp Addr 10700 Size 8 is a STT_GNU_IFUNC ====== Symbol __vfork Addr 10af0 Size 8 is a STT_GNU_IFUNC ====== Symbol vfork Addr 10af0 Size 8 is a STT_GNU_IFUNC ====== Symbol system_ifunc Addr 119d0 Size 8 is a STT_GNU_IFUNC ====== Symbol longjmp_ifunc Addr 10700 Size 8 is a STT_GNU_IFUNC ====== Symbol vfork_ifunc Addr 10af0 Size 8 is a STT_GNU_IFUNC ====== Symbol siglongjmp_ifunc Addr 10700 Size 8 is a STT_GNU_IFUNC ====== Symbol __vfork_ifunc Addr 10af0 Size 8 is a STT_GNU_IFUNC ====== Symbol __vfork@GLIBC_2.2.5 Addr 10af0 Size 8 is a STT_GNU_IFUNC ====== Symbol siglongjmp@GLIBC_2.2.5 Addr 10700 Size 8 is a STT_GNU_IFUNC ====== Symbol vfork@GLIBC_2.2.5 Addr 10af0 Size 8 is a STT_GNU_IFUNC ====== Symbol system@GLIBC_2.2.5 Addr 119d0 Size 8 is a STT_GNU_IFUNC ====== Symbol longjmp@GLIBC_2.2.5 Addr 10700 Size 8 is a STT_GNU_IFUNC ==== For libc-2.23.so: ====== Symbol __gettimeofday Addr c05e0 Size a8 is a STT_GNU_IFUNC ====== Symbol strcpy Addr 8e150 Size 35 is a STT_GNU_IFUNC ====== Symbol wmemcmp Addr afb50 Size 37 is a STT_GNU_IFUNC ====== Symbol strncmp Addr 8eb30 Size 41 is a STT_GNU_IFUNC ====== Symbol stpncpy Addr 929f0 Size 35 is a STT_GNU_IFUNC ====== Symbol __mempcpy_chk Addr 11cec0 Size 68 is a STT_GNU_IFUNC ====== Symbol strncpy Addr 903d0 Size 35 is a STT_GNU_IFUNC ====== Symbol time Addr c0500 Size a8 is a STT_GNU_IFUNC ====== Symbol strpbrk Addr 90700 Size 22 is a STT_GNU_IFUNC ====== Symbol strspn Addr 90a80 Size 22 is a STT_GNU_IFUNC ====== Symbol __stpncpy Addr 929f0 Size 35 is a STT_GNU_IFUNC ====== Symbol __strcasecmp Addr 92a80 Size 54 is a STT_GNU_IFUNC ====== Symbol memset Addr 92230 Size 41 is a STT_GNU_IFUNC ====== Symbol strstr Addr 916b0 Size 21 is a STT_GNU_IFUNC ====== Symbol strcspn Addr 8e270 Size 22 is a STT_GNU_IFUNC ====== Symbol memcmp Addr 91c40 Size 37 is a STT_GNU_IFUNC ====== Symbol mempcpy Addr 923b0 Size 68 is a STT_GNU_IFUNC And 80 more... This Diff adds parsing for `STT_GNU_IFUNC` symbols as well Reviewed By: yfeldblum Differential Revision: D6282727 fbshipit-source-id: 71b7c44831e4ddfdccf1e794cb86e049e14227bc
-
Teng Qin authored
Summary: When using `folly::symbolizer`, it's very often that we want to use `iterateSectionsWithType` iterate through sections of a few types using the same callback. Current approach would require iterating the section header multiple times. This Diff add `iterateSectionsWithTypes`, which is basically just `iterateSectionsWithType` but accepts multiple section types. It is very similar to D6279651. However, in this Diff we did not change implementation of `getDefinitionByAddress` and `getSymbolByName`, since going through `.dynsym` separately would improve the efficiency of single-address or single-symbol lookup. However, for the use cases that we want to iterate through all symbols of an ELF file, this new interface would be useful. Reviewed By: anakryiko, yfeldblum Differential Revision: D6281449 fbshipit-source-id: f9afe0a0e95d9fafcd041014abad8ca86d1a882f
-
Yedidya Feldblum authored
Summary: [Folly] Fix `folly/test/Makefile.am`. Closes #709. Reviewed By: meyering Differential Revision: D6282009 fbshipit-source-id: 0f2a992e92d4b94a535f29341920c9f2959819d7
-
Teng Qin authored
Summary: When using `folly::symbolizer`, it's very often that we want to use `iterateSymbolsWithType` iterate through symbols of a few types using the same callback. Current approach would require iterating the section multiple times. This Diff adds `iterateSymbolsWithTypes`, which is basically just `iterateSymbolsWithType` but accepts symbol types. This Diff also updated implementation of `getDefinitionByAddress` and `getSymbolByName` which currently does two iterations for `STT_OBJECT` and `STT_FUNC`. Reviewed By: yfeldblum Differential Revision: D6279651 fbshipit-source-id: a661dd15f18e4f2f63dbcca615f5a86d92e528ea
-
Yedidya Feldblum authored
Summary: [Folly] In `SemiFuture` members, fix `DCHECK` of pointer types. Use `nullptr !=` to avoid ` error: ISO C++ forbids comparison between pointer and integer`. Closes #708. Reviewed By: Orvid Differential Revision: D6277832 fbshipit-source-id: 8f65065d5347c6ac407b99cb780c38935e901362
-
Phil Willoughby authored
Summary: Testing indicates that GCC ignores the cold attribute when the function is available for inlining. Because Unexpected is a template class we can't make the constructors non-inline, but we can make it derive from a class with a cold constructor, which has the effect of making all the Unexpected constructors implicitly cold. Reviewed By: yfeldblum Differential Revision: D6261013 fbshipit-source-id: 482e49253d5b104742018133c53fb60279dd9f9b
-
Christopher Dykes authored
Summary: Because every other exception is already marked as public. Reviewed By: yfeldblum Differential Revision: D6275414 fbshipit-source-id: 8e1fc4ceafedbdb44733ab57aecb6050c4160994
-
- 08 Nov, 2017 5 commits
-
-
Arkady Shapkin authored
Summary: gflags and glog require some compile definitions when linking statically /cc Orvid Closes https://github.com/facebook/folly/pull/693 Reviewed By: yfeldblum Differential Revision: D6264382 Pulled By: Orvid fbshipit-source-id: 60c8af429f10e778d9c313f40227892238829f63
-
Yedidya Feldblum authored
Summary: [Folly] Heterogeneous lookups for `sorted_vector` types. When the `Compare` type has member type or alias `is_transparent`, enable template overloads of `count`, `find`, `lower_bound`, `upper_bound`, and `equal_range` on both `sorted_vector_set` and `sorted_vector_map`. This is the protocol found in the equivalent `std::set` and `std::map` member functions. > This overload only participates in overload resolution if the qualified-id `Compare::is_transparent` is valid and denotes a type. They allow calling this function without constructing an instance of `Key`. > > http://en.cppreference.com/w/cpp/container/set/count (same wording in all 10 cases) Reviewed By: nbronson Differential Revision: D6256989 fbshipit-source-id: a40a181453a019564e8f7674e1e07e241d5ab068
-
Andre Pinto authored
Summary: Use const_cast instead of implicitly dropping const modifier. Reviewed By: reanimus Differential Revision: D6269200 fbshipit-source-id: 61e1708c88a4139d3fdd9cf89f4ff778d0354bb2
-
Andre Pinto authored
Summary: Include folly/Portability.h in GenerateFingerprintTables, so that gflags namespace gets defined. Reviewed By: yfeldblum Differential Revision: D6265226 fbshipit-source-id: d509dc163564420151de7007ad4336d7e5ef9625
-
Igor Sugak authored
Summary: Exposed by the latest clang: ```lang=bash folly/test/FixedStringTest.cpp:52:36: error: unused variable 's' [-Werror,-Wunused-variable] constexpr folly::FixedString<42> s{"hello world"}; ^ folly/gen/test/StringBenchmark.cpp:176:15: error: unused variable 'line' [-Werror,-Wunused-variable] StringPiece line(kLine); ^ ``` Reviewed By: yfeldblum Differential Revision: D6264853 fbshipit-source-id: 5cf4b0a8c99eaa31c2499746c70ddc49fdd73074
-
- 07 Nov, 2017 2 commits
-
-
Christopher Dykes authored
Summary: It was broken, now it is fixed. https://developercommunity.visualstudio.com/content/problem/145407/incorrect-c3520-within-noexcept-expression-in-alia.html Reviewed By: yfeldblum Differential Revision: D6254219 fbshipit-source-id: a03961db97d7ac211103655229c1ea703405826a
-
Adam Simpkins authored
Summary: AsyncFileWriter uses a separate thread to write messages to the file descriptor. This diff makes us call setThreadName() to set the name of this thread to `log_writer`. Reviewed By: bolinfest Differential Revision: D6238229 fbshipit-source-id: 9c93d80e7ac989e03bc3160bb2f135d67e15c8be
-