author | Rich Felker <dalias@aerifal.cx> | 2015年03月03日 22:50:02 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015年03月03日 22:50:02 -0500 |
commit | 56fbaa3bbe73f12af2bfbbcf2adb196e6f9fe264 (patch) | |
tree | 09fbe371b108e25bb2f9c90e74da356359950d29 /src/malloc/malloc.c | |
parent | eb4bd8d8bb5c9f535ee8250edd4efbd3d4f84c5a (diff) | |
download | musl-56fbaa3bbe73f12af2bfbbcf2adb196e6f9fe264.tar.gz |
-rw-r--r-- | src/malloc/malloc.c | 10 |
diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c index 7932a975..70c7b3f3 100644 --- a/src/malloc/malloc.c +++ b/src/malloc/malloc.c @@ -25,7 +25,7 @@ struct chunk { }; struct bin { - int lock[2]; + volatile int lock[2]; struct chunk *head; struct chunk *tail; }; @@ -33,10 +33,10 @@ struct bin { static struct { uintptr_t brk; size_t *heap; - uint64_t binmap; + volatile uint64_t binmap; struct bin bins[64]; - int brk_lock[2]; - int free_lock[2]; + volatile int brk_lock[2]; + volatile int free_lock[2]; unsigned mmap_step; } mal; @@ -205,7 +205,7 @@ fail: static int init_malloc(size_t n) { - static int init, waiters; + static volatile int init, waiters; int state; struct chunk *c; |