- 24 May, 2017 1 commit
-
-
Yedidya Feldblum authored
Summary: [Folly] RFC: Embed `exception_wrapper` directly into `Try`. Rather than storing it elsewhere on the heap. With `exception_wrapper` at 24 bytes on x64, it may now be small enough. However, it will expand the size of `Try<T>` for `sizeof(T) <= 16`, giving `Try` a new minimum size of 32 bytes on x64 instead of 16. Reviewed By: ericniebler Differential Revision: D5051436 fbshipit-source-id: 10d59686d64382c88d54340c97567eafb3e2f682
-
- 23 May, 2017 3 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Fix some old license headers. Reviewed By: meyering Differential Revision: D5110463 fbshipit-source-id: c7bb57194e0d33fbe1c6ddaa7d94437833b0cb0d
-
Eric Niebler authored
Add FOLLY_NODISCARD for [[nodiscard]] attribute when it exists, FOLLY_WARN_UNUSED_RESULT uses FOLLY_NODISCARD. Summary: The `nodiscard` attribute was added to standard C++ in C++17. Prefer the standard formulation when it is available; otherwise, use `__attribute__((__warn_unused_result__))` on compilers that support the GNU extensions, and `_Check_return_` on MSVC. The old `FOLLY_WARN_UNUSED_RESULT` is now expands to `FOLLY_NODISCARD`. Reviewed By: yfeldblum Differential Revision: D5105137 fbshipit-source-id: 9aa22e81cd9f0b89f9343433aeae3ba365227ccb
-
Christopher Dykes authored
Summary: This silences a few warnings under MSVC, and gets Folly closer to being able to compile with `-Wconversion` enabled. Reviewed By: yfeldblum Differential Revision: D5100686 fbshipit-source-id: e5e04c7aa143597e151a56a4d1f90dda26d0033b
-
- 22 May, 2017 3 commits
-
-
Christopher Dykes authored
Summary: Because just having a linter enforce it isn't good enough to catch everything. Reviewed By: yfeldblum Differential Revision: D5101828 fbshipit-source-id: a1bc482b37139a1eddeb93bc298596af950aa87d
-
Christopher Dykes authored
Summary: This makes it easier to consume Folly from a non-cmake project. Note that this also requires making libevent, which was previously categorized as a semi-portable header into a non-portable header, meaning it can't be referenced directly. (libevent includes `Windows.h` in one of its headers -_-....) Reviewed By: yfeldblum Differential Revision: D5106051 fbshipit-source-id: 5ce2d4188c9036d6ab206af3036c8fd4b09516a4
-
Kyle Nekritz authored
Summary: To take advantage of read locks. Reviewed By: siyengar Differential Revision: D5106090 fbshipit-source-id: a32afd698e9204196aa3d23f21a7d41803b2eb66
-
- 20 May, 2017 7 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Refactor `folly/gen/test/StringTest.cpp`. Prefer to compare whole values once per test case, rather than sequentially comparing each part in turn. Reviewed By: andrewjcg Differential Revision: D5101467 fbshipit-source-id: 3d19d32bc6a5ecc5863bea76c4292935c775fe75
-
Song Zhou authored
Summary: new method byLineFull will not trim the delimiter so that consumers can check if final line is ended up with delimiter or not. Reviewed By: philippv, yfeldblum Differential Revision: D5085371 fbshipit-source-id: 5045127ee11d008e3cd7d13d33bffad280fe0a7e
-
Stephen Chen authored
Summary: Looks like we never tried to compile or run the PicoSpinLock under aarch64. There were two problems: if sizeof(IntType) is 64, we try to do 1 << 63 in lock and unlock. This doesn't compile because sizeof(1) is 32. Also for try_lock, we were returning the data instead of checking for the locked bit. Reviewed By: djwatson, yfeldblum Differential Revision: D5091656 fbshipit-source-id: 4f81b8b32633e87b491548a1a24b9bcf20264063
-
Christopher Dykes authored
Summary: A define was needed to be able to link when built against a shared-library version of gmock and gtest. Reviewed By: yfeldblum Differential Revision: D5100409 fbshipit-source-id: 9a4c9df20f682a25edde642c451476b2d1e1ae22
-
Christopher Dykes authored
Summary: This includes adding options to toggle `/std:c++latest`, and `WIN32_LEAN_AND_MEAN`, along with giving a nice drop-down selector to `MSVC_FAVORED_ARCHITECTURE` when configured via the GUI, dropping `_WINSOCK_DEPRECATED_NO_WARNINGS` as it wasn't needed, and re-enabling warnings 4365 and 4775 within the scope of the standard library. Reviewed By: yfeldblum Differential Revision: D5100586 fbshipit-source-id: 87b20c6415391d4f0c75837cad5bc312910bf49f
-
Christopher Dykes authored
Summary: MSVC needs these to be marked as `static` in order to be accessible within the lambdas without capturing them. Reviewed By: yfeldblum Differential Revision: D5099607 fbshipit-source-id: 0270e2191d504f74b1902789b662e1766b2056c4
-
Christopher Dykes authored
Summary: MSVC is being grumpy, and I want to continue to work from the preview build, so commit the workaround, as there's no significant difference. Upstream bug report: https://developercommunity.visualstudio.com/content/problem/59614/compiler-crash-when-constexpr-constructing-stdchro.html Reviewed By: yfeldblum Differential Revision: D5099876 fbshipit-source-id: 64d5573d78b14339ff3177dd910a22787463ccd2
-
- 19 May, 2017 3 commits
-
-
Christopher Dykes authored
Summary: `std::hash` lives in `<functional>`, not `<xstddef>`. Reviewed By: yfeldblum Differential Revision: D5097468 fbshipit-source-id: d0684491d1d4b0f83f07ad837a66a915ce2ec8a6
-
Shoaib Meenai authored
Summary: 4.0 has been out for three months now, so it's pretty safe to remove them. Reviewed By: Orvid, yfeldblum, mzlee Differential Revision: D5096007 fbshipit-source-id: 595c3e86cd7cf1a1706f27f107fb0af8ab89a676
-
Xiao Shi authored
Summary: Use SafeAssert instead of assert. Reviewed By: nbronson Differential Revision: D5085575 fbshipit-source-id: daeff427b9b1fc5dff6ea986d16a70364acd2dd7
-
- 17 May, 2017 2 commits
-
-
Alexey Spiridonov authored
Summary: Name all repeating function threads for ease of debugging. Reviewed By: yfeldblum Differential Revision: D5065281 fbshipit-source-id: e875e654dfa644a265e44416baf5fbf23c9da434
-
Phil Willoughby authored
Summary: Previously we defined an assignment from std::string on all basic_fbstring specialisations, but we don't actually want to do that because it's nonsense to construct a basic_fbstring<char16_t> from an std::string. Equally it's not nonsense to construct one of those from an std::u16string but the previous code didn't allow it. We now permit basic_fbstring<C, T, A1, S> to be constructed or assigned-to from std::basic_string<C, T, A2>. The character type and traits must match but the allocator is permitted to vary. Background on my determination that the allocator type was unimportant and could be disregarded: In part this is because C++17 made the same choice for basic_string_view. Another factor was C++17's std::pmr::string (it's a std::string with a different allocator) which I thought should be convertible to fbstring in the same way as std::string. Reviewed By: Gownta Differential Revision: D5060569 fbshipit-source-id: f8984c528b76356240970c67916c58995d3f228d
-
- 16 May, 2017 4 commits
-
-
Alexey Spiridonov authored
Summary: It is pretty confusing to inherit from classes that manage threads. See the docblocks in this diff. Reviewed By: yfeldblum Differential Revision: D4973498 fbshipit-source-id: 2fcf1ddf68ef46d4d78a9b40f304262064862715
-
Stephen Chen authored
Summary: folly/detail/ChecksumDetail.h gets included in Checksum.h and it unconditionally includes <immintrin.h>. This doesn't compile on aarch64 platform. Add #ifdefs for this. Reviewed By: yfeldblum Differential Revision: D5048636 fbshipit-source-id: d2074eb1b01487b02d95f3e2eebe683237d918fe
-
Yedidya Feldblum authored
Summary: [Folly] Fix violations of `unused-lambda-capture`. Reviewed By: Orvid Differential Revision: D5060391 fbshipit-source-id: 34aabc847719603d13da8f2b52a7ec187d803a4a
-
Christopher Dykes authored
Summary: It's *almost* dead. This switches things to explicitly reference `std::make_unique` so that `folly::make_unique` can be marked as deprecated until mobile catches up and it can be killed completely. Reviewed By: yfeldblum Differential Revision: D5026584 fbshipit-source-id: aefc8cb3de84583fd3722fdb9dfea620884590c5
-
- 15 May, 2017 5 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Drop support for deprecated associative containers. Namely, `__gnu_cxx::hash_set` and `__gnu_cxx::hash_map`. Reviewed By: wqfish Differential Revision: D5058813 fbshipit-source-id: ebbcf10765f5d06776ee8f697cfb78614a3a566c
-
Nathan Bronson authored
Summary: This diff adds StampedPtr, which packs a pointer and a uint16_t into a uint64_t with maximum portability and without adding any additional functionality. Reviewed By: yfeldblum, davidtgoldblatt Differential Revision: D4804614 fbshipit-source-id: 25fe7aff47d1e126ac8edfff4eb0bbb1d34071aa
-
Maxim Georgiev authored
Summary: AsyncSocket::handleErrMessages() should check if the error message callback is still installing before calling it, since the callback could be uninstaled on the previous loop iteration. Reviewed By: yfeldblum Differential Revision: D5051001 fbshipit-source-id: fc01932c0d36bd8f72bf1905f12211fb83d28674
-
Yedidya Feldblum authored
Summary: [Folly] List the new GCC 4.9 and C++14 minimum requirement. We no longer support GCC 4.8 or C++11. Closes #590. Reviewed By: Orvid, mzlee Differential Revision: D5058942 fbshipit-source-id: 0545d1bb294494e5ef5f17a40c9cf3ac688bd8d0
-
Arkady Shapkin authored
Summary: MSVC doesn't support `^` and `&` operator for __m128i type Closes https://github.com/facebook/folly/pull/594 Reviewed By: yfeldblum, Orvid Differential Revision: D5053356 Pulled By: djwatson fbshipit-source-id: f789824052e0c679c265c83ad704109805c21402
-
- 13 May, 2017 1 commit
-
-
Koen De Keyser authored
Summary: Problems: - The vDSO check code in configure.ac is broken, and will always fail (uses AC_LANG_PROGRAM but with arguments in the AC_LANG_SOURCE style) - On Linux, using dlopen/dlsym requires -ldl (libdl) during the link phase. This check was missing and this argument was not added to the linker arguments. - On a Linux system without vDSO support, libfolly.so still uses vDSO in ClockGettimeWrappers.cpp Solution: - Switched to AC_LANG_SOURCE - Required libdl to exist when build target is Linux. This also adds this dependency to libfolly.la, resulting in fixing a dependency issue for Proxygen (recent Proxygen build would have issues in building examples due to failing linking step due to missing dlopen / dlsym / dlclose symbols) - In ClockGettimeWrappers.cpp, checking if `__linux__` is set is not sufficient to determine that the system has vDSO support. The autoconf script already exposes a correct check: FOLLY_HAVE_LINUX_VDSO (this is already used in folly/detail/CacheLocality.cpp), so switched to that one. Closes https://github.com/facebook/folly/pull/592 Reviewed By: yfeldblum Differential Revision: D5049816 Pulled By: Orvid fbshipit-source-id: 58b2ed4c4101274505c61b4825accf262c0d56ef
-
- 12 May, 2017 7 commits
-
-
Philip Pronin authored
Summary: Return not just number of cancelled ops, but all of them as well. Test was incorrectly assuming `wait(1)` will return exactly one operation, fix that as well. Reviewed By: ot Differential Revision: D5054684 fbshipit-source-id: 1c53c3f7ba855d1fcfeac8b1b27f90f0872d2c21
-
Yedidya Feldblum authored
Summary: [Folly] `exception_wrapper::get_object<>`. Returns a pointer to the stored object, if the template type parameter is of the right sort. Reviewed By: jsedgwick Differential Revision: D5000720 fbshipit-source-id: 2869439085e8dfb56e6cb439794b03876b7d715c
-
Yinghai Lu authored
Summary: This diff shows an issue in `folly::retrying`. When the future generation function throws an exception and `folly::retrying` is nested in another functor that returns Future, it will throw `broken promise` instead of the actual exception message, which can be very generic and confusing. Fix is to capture the exception so that exact error message can be propagated up. Reviewed By: yfeldblum Differential Revision: D5050690 fbshipit-source-id: 5b9b24977788f60aa778bb8e9cdf4281ea9a0023
-
James Sedgwick authored
Summary: To satisfy internal linter Reviewed By: yfeldblum Differential Revision: D4957870 fbshipit-source-id: 191ac768790fbd8cc8a4d24036c016644ff1d125
-
James Sedgwick authored
Summary: changes as suggested by FB-internal linter Reviewed By: yfeldblum Differential Revision: D4957742 fbshipit-source-id: c9d94c477d24f153cab0d25edccfd39ff31fdfdf
-
James Sedgwick authored
Summary: suggested by internal linter Reviewed By: Orvid Differential Revision: D4958232 fbshipit-source-id: 69c67d80be092db17703d672524124ca5ef7ba32
-
Eric Niebler authored
Summary: Before this change, when a non-const FunctionRef lvalue is copied, it is treated as any other callable: it is wrapped with an indirection. That's semantically incorrect and potentially creates lifetime problems. Instead, use the compiler generated copy constructor, which only copies the object and function pointers. Reviewed By: yfeldblum Differential Revision: D5040843 fbshipit-source-id: f691060bdced2e287ba22d22b961c02c2b924147
-
- 11 May, 2017 4 commits
-
-
Nick Terrell authored
Summary: Instead of using `UNKNWON_UNCOMPRESSED_LENGTH` use an `Optional`. Reviewed By: yfeldblum Differential Revision: D5038919 fbshipit-source-id: 7fb60542277019996be3ff50509df5a5060cb1a0
-
Ashwin Bharambe authored
Summary: We would like to use `folly/Optional` in settings where exceptions are disabled. An example is ObjC++ codebases where supporting exceptions doesn't quite help (since objc_msgSend() can throw) and yet we need to pay the additional binary size cost for the unwind tables. This patch makes a small change to outline the "assert" utility included inside Optional.h Reviewed By: yfeldblum, mzlee Differential Revision: D5030172 fbshipit-source-id: 7def3c6eda22c41c8cab2037444978e0a4c50abf
-
Philip Pronin authored
Summary: It should be implemented with `io_cancel`, but it is not supported (D682836), so still have to drain events, ignoring only op callbacks. Reviewed By: luciang, ot Differential Revision: D5044020 fbshipit-source-id: 0bcd04c91a437fccaf2189ccf771a1cb61c68942
-
Victor Zverovich authored
Summary: This diff fixes a race that happens on destruction of `ScopedEventBaseThread`. ``` Thread1: ~ScopedEventBaseThread() Thread1: eb_.terminateLoopSoon() <- preempted just after stop_ = true Thread2: eb->loopForever() in run(...) exits because stop_ is true Thread2: ... Thread2: eb->~EventBase() Thread1: queue_->putMessage(nullptr) <- accesses destroyed EventBase ``` Reviewed By: yfeldblum Differential Revision: D5042654 fbshipit-source-id: 95515ed7cde09ff5f125ef121bea86ab3907f98a
-