mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-25 14:52:28 +00:00
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:
parent
d7b88734cd
commit
e522aa3a07
189 changed files with 1363 additions and 1217 deletions
|
@ -1,8 +1,7 @@
|
|||
#include "libc/x/x.h"
|
||||
/* clang-format off */
|
||||
|
||||
static bool big5_decmap_once;
|
||||
static void *big5_decmap_ptr;
|
||||
static _Atomic(void *) big5_decmap_ptr;
|
||||
static const unsigned char big5_decmap_rodata[] = {
|
||||
0xed, 0xd0, 0x3b, 0x4b, 0x15, 0x00, 0x1c, 0x86, 0xf1, 0x73, 0x34, 0xef, 0x69,
|
||||
0xde, 0x32, 0xcb, 0x63, 0x69, 0xa9, 0x59, 0x5a, 0x5e, 0xce, 0xc9, 0x73, 0xf2,
|
||||
|
@ -31,9 +30,7 @@ static const unsigned char big5_decmap_rodata[] = {
|
|||
};
|
||||
|
||||
optimizesize void *big5_decmap(void) {
|
||||
if (big5_decmap_once) return big5_decmap_ptr;
|
||||
return xload(&big5_decmap_once,
|
||||
&big5_decmap_ptr,
|
||||
return xload(&big5_decmap_ptr,
|
||||
big5_decmap_rodata,
|
||||
305, 1024); /* 29.7852% profit */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue