Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tags: lyrl/folly

Tags

v2021.08.23.00

Toggle v2021.08.23.00's commit message
ConcurrentHashMapSIMD: Return iterator to new inserted item

Summary:
Fix SIMD version to return iterator to new item in insertion operations.

Added a test to detect the incorrect behavior.

Changed existing tests that di not test the SIMD version to do so. Three of these tests fail without the fix.

Reviewed By: davidtgoldblatt

Differential Revision: D30435627

fbshipit-source-id: 20ba400be9213fa138fda06e0e7bd84cf9d8cf12

v2021.08.02.00

Toggle v2021.08.02.00's commit message
fix race handling bug in futures interrupt-handler

Summary:
Setting the interrupt-handler races with setting the interrupt-exception. This is expected to occur on occasion and should be handled in both `setInterruptHandler` and `raise`. The latter is correct but the former has a bug when, if the race happens, a moved-from interrupt-handler is invoked. The fix is to be sure to invoke a non-moved-from handler.

For consistency, always performs precisely one copy or move of the handler and always invokes the handler as an lvalue-ref-to-non-const.

Reviewed By: iahs

Differential Revision: D29974165

fbshipit-source-id: faf083e97c042fda0622801fc94bbc6fbca910fd

v2021.07.22.00

Toggle v2021.07.22.00's commit message
thrift: varint: BMI2 (pdep) based varint encoding: branchless 2-5x fa…

…ster than loop unrolled

Summary:
BMI2 (`pdep`) varint encoding that's mostly branchless. It's 2-5x faster than the current loop-unrolled version.

Being mostly branchless there's less variability in micro-benchmark runtime compared to the loop-unrolled version:
- the loop-unrolled versions are slowest when encoding random numbers across the entire 64-bit range (some likely large) and branch prediction has most failures.

Kept the fast-pass for values <127 (encoded in 1 byte) which are likely to be frequent. I couldn't find a fully branchless version that performed better anyway.

TLDR:
- `u8`: unroll the two possible values (1B and 2B encoding). Faster in micro-benchmarks than branchless versions I tried (needed more instructions to produce the same value without branches).
- `u16` & `u32`:
-- u16 encodes in up to 3B, u32 in up to 5B.
-- Use `pdep` to encode into a u64 (8 bytes). Write 8 bytes to `QueueAppender`, but keep track of only the bytes that had to be written. This is faster than appending a buffer of bytes using &u64 and size.
-- u16 could be written by encoding using `_pdep_u32` (3 bytes max fit in u32) and using smaller 16B lookup tables. In micro-benchmark that's not faster than using the same code as the one to encode u32 using `_pdep_u64`. In prod will perform better due to sharing the same lookup tables with u32 and u64 versions (less d-cache pressure).
- `u64`: needs up to 10B. `pdep` to encode first 8B and unconditionally write last 2B too (but keep track of `QueueAppender` size properly).

Reviewed By: vitaut

Differential Revision: D29250074

fbshipit-source-id: 1f6a266f45248fcbea30a62ed347564589cb3348

v2021.07.20.01

Toggle v2021.07.20.01's commit message
Use CoreCachedSharedPtr in Singleton

Summary: `CoreCachedSharedPtr` is almost as fast as `ReadMostlySharedPtr`, so we can use it to have a better default that does not have pathological behavior under heavy contention. `try_get_fast()` is still useful if we need to squeeze out the last cycle.

Reviewed By: philippv, luciang

Differential Revision: D29812053

fbshipit-source-id: 49e9e53444f8099dbfe13e36c3c07c1b57bb89fb

v2021.07.20.00

Toggle v2021.07.20.00's commit message
Fix stub of sockets for EMSCRIPTEN and XROS

Summary:
The current implementation of function stubs in `SocketFileDescriptorMap.cpp` generates the following build errors:
```
stderr: xplat/folly/net/detail/SocketFileDescriptorMap.cpp:171:3: error: 'socketToFd' has a non-throwing exception specification but can still throw [-Werror,-Wexceptions]
  throw std::logic_error("Not implemented!");
  ^
xplat/folly/net/detail/SocketFileDescriptorMap.cpp:170:30: note: function declared non-throwing here
int SocketFileDescriptorMap::socketToFd(void* sock) noexcept {
```
because the methods are stubbed out to throw and exception even though they are marked as `noexcept`.

To fix the warning the subbing implementation is changed to call `std::terminate()` instead of throwing an exception. According to the language specification (https://en.cppreference.com/w/cpp/language/noexcept_spec) this should not result in any change in run-time behavior, since throwing and exception in a method marked as `noexcept` is effectively a call to `std::terminate()`.

Differential Revision: D29687674

fbshipit-source-id: 77405d8a31e45c8836e8746c9b25e12ef06335c4

v2021.06.28.00

Toggle v2021.06.28.00's commit message
Add computeChainCapacity function to IOBuf

Summary:
This diff adds a computeChainCapacity method to IOBuf.

This method will loop through each chain of an IOBuf and return the total capacity of all IOBuf chains. This method is used very similarly to computeChainDataLength(), except rather than returning total data length, it returns total capacity.

Reviewed By: yfeldblum

Differential Revision: D28875393

fbshipit-source-id: 7e5f4a93916fa6c30eef8f8ee8c346a4537302af

v2021.06.14.00

Toggle v2021.06.14.00's commit message
Add rsa_pss signature schemes to SSLCommonOptions

Summary: Required to support RSA certificates in TLS 1.3.

Reviewed By: knekritz

Differential Revision: D28606758

fbshipit-source-id: 0b75eccf207c1327e590675137ce3289956d8771

v2021.06.07.00

Toggle v2021.06.07.00's commit message
Add rsa_pss signature schemes to SSLCommonOptions

Summary: Required to support RSA certificates in TLS 1.3.

Reviewed By: knekritz

Differential Revision: D28606758

fbshipit-source-id: 0b75eccf207c1327e590675137ce3289956d8771

v2021.05.31.00

Toggle v2021.05.31.00's commit message
Add rsa_pss signature schemes to SSLCommonOptions

Summary: Required to support RSA certificates in TLS 1.3.

Reviewed By: knekritz

Differential Revision: D28606758

fbshipit-source-id: 0b75eccf207c1327e590675137ce3289956d8771

v2021.05.24.00

Toggle v2021.05.24.00's commit message
hazptr: Improve documentation

Summary: Improve documentation and make the description of synchronous reclamation  consistent with the current implementation.

Reviewed By: yfeldblum

Differential Revision: D28575528

fbshipit-source-id: e8f37e02d18b12a0e653264c128492a98cba6a1d