Tags: tnicklin/folly
Tags
Remove extra semi colon from folly/experimental/coro/Merge-inl.h Summary: `-Wextra-semi` or `-Wextra-semi-stmt` If the code compiles, this is safe to land. Reviewed By: Orvid Differential Revision: D57975880 fbshipit-source-id: 2d60cb964fc917722e735c1afce1412f0f4c4458
Back out "Back out "Revert D61286579"" Summary: Original commit changeset: 251ac011c75f Original Phabricator Diff: D61629106 Reviewed By: dogdoggoos Differential Revision: D61776376 fbshipit-source-id: aa8a17c55ccedd8e5c218ab19f985bace26fe2dd
Reduce duplication between `TaskPromise` specializations Summary: Make the `TaskPromise<>` leaf classes as simple as they can be. This shortens the code by 30 lines, and makes it easier to follow. Reviewed By: yfeldblum Differential Revision: D61249849 fbshipit-source-id: c12ca1d96c2c99fd85d53df9a77146450d525ca6
Create an enum for superconsole interaction toggles Summary: Current implementation of console toggles relies on `char` and display is error-prone (.e.g we forgot to add `x` option to the Help). I initially tried to fix this in D60960924 but then realized that this could happen in the future. Better to make it type-safe so that we get it for free (via `strum::EnumIter`). Also rename `ConsoleInteraction` to `SuperConsoleInteraction` to signify that these only for for superconsole. Reviewed By: stepancheg Differential Revision: D60965981 fbshipit-source-id: e0008b46dd752446b45877e6f0c2acf43f528c7b
folly concepts facebook#1 (facebook#2249) Summary: Pull Request resolved: facebook#2249 We have a need for some common concepts that are used in many places. This is a proposal, please let me know what you think. Usages example: `uncvref_same_as`: https://www.internalfb.com/code/fbsource/[a71ce59323a15fd7559d6132c1f8e2d0256ca7cb]/fbcode/multifeed/entrepot/lib/zdb_manager/ZdbUtil.h?lines=237 `uncvref_instantiated_from`: https://www.internalfb.com/code/fbsource/[b366209d2c108133a0545edc7943b9461323623b]/fbcode/multifeed/mfaction/MFHashSerializer.h?lines=38 Reviewed By: yfeldblum Differential Revision: D59396081 fbshipit-source-id: 4912c2f9fe683f4d3b37fce43466c9281d03ce13
Add `SparseByteSet::size()` method Summary: Useful, when `SparseByteSet` used as fast pre check for heavyweight operation. Reviewed By: marksantaniello Differential Revision: D60285173 fbshipit-source-id: 8deac984b0f00096448af51fdfee283d0bb13ca2
simplify cache local/lifetime coordination in SingletonRelaxedCounter Summary: Rather than giving up on constraining the cache thread_local local and cache thread_local lifetime to be in the same DSO, now constrain it and assert on the constraint. This allows the cache thread_local local and the cache thread_local lifetime to be 1:1 with each other, rather than M:N with each other without the constraint. Note that there is now no cross-DSO merging of these thread_local variables - they are now explicitly per-DSO. Differential Revision: D59144274 fbshipit-source-id: 73b3a426059321bb9abfcb92fdbdd3547656adc8
folly: fix github ci tests on macos arm (facebook#2253) Summary: These were [failing on github](https://github.com/facebook/folly/actions/runs/9923539774/job/27413784309#step:48:6919) I think the problem was the macos runner changed from intel to arm, expectations needed updating for arm. Pull Request resolved: facebook#2253 Test Plan: ``` ./build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. folly ./build/fbcode_builder/getdeps.py --allow-system-packages --no-facebook-internal test --no-testpilot folly ``` Before, broken ``` + /opt/homebrew/opt/cmake/bin/ctest \ + --output-on-failure \ + -j \ + 3 \ + --rerun-failed Test project /private/var/folders/xz/lz5thm6s3vb1vdkk77vmkgbr0000gn/T/fbcode_builder_getdeps-ZUsersZrunnerZworkZfollyZfollyZbuildZfbcode_builder/build/folly Start 1646: arena_test.Arena.SizeSanity Start 2039: constexpr_math_test.ConstexprMathTest.constexpr_exp_floating 1/2 Test facebook#1646: arena_test.Arena.SizeSanity ....................................***Failed 0.01 sec Note: Google Test filter = Arena.SizeSanity [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from Arena [ RUN ] Arena.SizeSanity /Users/runner/work/folly/folly/folly/memory/test/ArenaTest.cpp:81: Failure Expected: (arena.totalSize()) <= (maximum_size), actual: 1544 vs 1536 /Users/runner/work/folly/folly/folly/memory/test/ArenaTest.cpp:91: Failure Expected: (arena.totalSize()) <= (maximum_size), actual: 1544 vs 1536 [ FAILED ] Arena.SizeSanity (0 ms) [----------] 1 test from Arena (0 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test suite ran. (0 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] Arena.SizeSanity 1 FAILED TEST 2/2 Test facebook#2039: constexpr_math_test.ConstexprMathTest.constexpr_exp_floating ...***Failed 0.01 sec Note: Google Test filter = ConstexprMathTest.constexpr_exp_floating [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from ConstexprMathTest [ RUN ] ConstexprMathTest.constexpr_exp_floating /Users/runner/work/folly/folly/folly/test/ConstexprMathTest.cpp:990: Failure Expected equality of these values: std::exp(471.L) Which is: 3.5702693074778485e+204 a Which is: 3.5702693074778518e+204 [ FAILED ] ConstexprMathTest.constexpr_exp_floating (0 ms) [----------] 1 test from ConstexprMathTest (0 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test suite ran. (0 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] ConstexprMathTest.constexpr_exp_floating 1 FAILED TEST 0% tests passed, 2 tests failed out of 2 Total Test time (real) = 0.13 sec The following tests FAILED: 1646 - arena_test.Arena.SizeSanity (Failed) 2039 - constexpr_math_test.ConstexprMathTest.constexpr_exp_floating (Failed) ``` After, works: ``` ... 3067/3067 Test facebook#2213: fbstring_test.FBString.testFixedBugsD4355440 .........................................................***Skipped 0.03 sec 100% tests passed, 0 tests failed out of 3066 Total Test time (real) = 36.02 sec The following tests did not run: 1934 - small_locks_test.SmallLocks.PicoSpinLockThreadSanitizer (Skipped) 1946 - small_locks_test.SmallLocksk.MicroSpinLockThreadSanitizer (Skipped) 1993 - atomic_unordered_map_test.AtomicUnorderedInsertMap.MegaMap (Disabled) 2213 - fbstring_test.FBString.testFixedBugsD4355440 (Skipped) ``` Reviewed By: ndmitchell Differential Revision: D59733599 Pulled By: ahornby fbshipit-source-id: e7f00184e867a5bf296836ea8c4a4f2430d9635a
Make sure folly's memcpy/memset not replaced by glibc's implementation Summary: `__folly_memcpy` and `__folly_memset` are supposed to be used in prod. However, they may be replaced by libc's implementation when `link_group_map` is used. The issue comes from two places: (1) The `link_group_map` may cause "folly/__memcpy-use__/__objects__/memcpy.S.o" to be put after "libc.so" in the xxx.thinlto.index.argsfile. (2) Even if "folly/__memcpy-use__/__objects__/memcpy.S.o" comes before "libc.so", `__folly_memcpy` may still be replaced by libc's implementation in some cases. For example: if there's no reference to `memcpy` before "folly/__memcpy-use__/__objects__/memcpy.S.o", the symbol `memcpy` inside memcpy.S.o is considered to be a lazy symbol, which will be replaced by the definition inside "libc.so". To make sure `__folly_memcpy` and `__folly_memset` are linked, this diff sets link_whole for cpp_library memcpy-use and memset-use. Because memcpy-use and memset-use only contain the necessary symbols, link_whole doesn't cause size bloat. Reviewed By: WenleiHe Differential Revision: D58921357 fbshipit-source-id: f5c7161dda24edd1ac808042715931d9b8dfaf10
Change lock order expecation between StaticMeta.lock_ and ThreadEntry… …Set lock. Summary: The dispose() of a thread local copy of an object is called when a thread does a reset() on it. It can invoke arbitrary code including calling destroy() or reset() on other ThreadLocals. Such a call will need to acquire the StaticMeta's lock_. To enforce that lock order, we need to fix paths that today acquire a ThreadEntrySet lock after acquiring StaticMeta's lock_. Reviewed By: yfeldblum Differential Revision: D59076052 fbshipit-source-id: 0109d66b3a5f74d7460b8a2d27103f2e919677e9
PreviousNext