mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 12:18:31 +00:00
Apply even more fixups
- Finish cleaning up the stdio unlocked APIs - Make __cxa_finalize() properly thread safe - Don't log locks if threads aren't being used - Add some more mutex guards to places using _mmi - Specific lock names now appear in the --ftrace logs - Fix mkdeps.com generating invalid Makefiles sometimes - Simplify and fix bugs in the test runner infrastructure - Fix issue where sometimes some functions wouldn't be logged
This commit is contained in:
parent
4ddfc47d6e
commit
8cdec62f5b
87 changed files with 955 additions and 899 deletions
|
@ -858,25 +858,25 @@ dontdiscard __asan_die_f *__asan_report_memory_fault(void *addr, int size,
|
|||
void *__asan_morgue_add(void *p) {
|
||||
int i;
|
||||
void *r;
|
||||
pthread_mutex_lock(&__asan_lock);
|
||||
if (__threaded) pthread_mutex_lock(&__asan_lock);
|
||||
i = __asan_morgue.i++ & (ARRAYLEN(__asan_morgue.p) - 1);
|
||||
r = __asan_morgue.p[i];
|
||||
__asan_morgue.p[i] = p;
|
||||
pthread_mutex_unlock(&__asan_lock);
|
||||
if (__threaded) pthread_mutex_unlock(&__asan_lock);
|
||||
return r;
|
||||
}
|
||||
|
||||
static void __asan_morgue_flush(void) {
|
||||
int i;
|
||||
void *p;
|
||||
pthread_mutex_lock(&__asan_lock);
|
||||
if (__threaded) pthread_mutex_lock(&__asan_lock);
|
||||
for (i = 0; i < ARRAYLEN(__asan_morgue.p); ++i) {
|
||||
if (__asan_morgue.p[i] && weaken(dlfree)) {
|
||||
weaken(dlfree)(__asan_morgue.p[i]);
|
||||
}
|
||||
__asan_morgue.p[i] = 0;
|
||||
}
|
||||
pthread_mutex_unlock(&__asan_lock);
|
||||
if (__threaded) pthread_mutex_unlock(&__asan_lock);
|
||||
}
|
||||
|
||||
static size_t __asan_user_size(size_t n) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue