Make more threading improvements

- ASAN memory morgue is now lockless
- Make C11 atomics header more portable
- Rewrote pthread keys support to be lockless
- Simplify Python's unicode table unpacking code
- Make crash report write(2) closer to being atomic
- Make it possible to strace/ftrace a single thread
- ASAN now checks nul-terminated strings fast and properly
- Windows fork() now restores TLS memory of calling thread
This commit is contained in:
Justine Tunney 2022-11-01 22:36:03 -07:00
parent d7b88734cd
commit e522aa3a07
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
189 changed files with 1363 additions and 1217 deletions

View file

@ -1,8 +1,7 @@
#include "libc/x/x.h"
/* clang-format off */
static bool __cp949_encmap_once;
static void *__cp949_encmap_ptr;
static _Atomic(void *) __cp949_encmap_ptr;
static const unsigned char __cp949_encmap_rodata[29600] = {
0xb4, 0xbc, 0x0d, 0x54, 0x5b, 0x67, 0x9a, 0x26, 0xc8, 0xc5, 0xcf, 0xab, 0xb8,
0xcb, 0xee, 0x76, 0xaa, 0x9d, 0x99, 0xa4, 0x3b, 0xe9, 0x49, 0xce, 0x26, 0xdd,
@ -2284,9 +2283,7 @@ static const unsigned char __cp949_encmap_rodata[29600] = {
};
optimizesize void *__cp949_encmap(void) {
if (__cp949_encmap_once) return __cp949_encmap_ptr;
return xloadzd(&__cp949_encmap_once,
&__cp949_encmap_ptr,
return xloadzd(&__cp949_encmap_ptr,
__cp949_encmap_rodata,
29600, 54513, 33133, 2, 0x97300f27u); /* 44.6685% profit */
}