|
@@ -94,15 +94,11 @@ void *memalign(size_t alignment, size_t size) {
|
|
raw_block = create_raw_block((size_t) SYS_ALLOC_SIZE,
|
|
raw_block = create_raw_block((size_t) SYS_ALLOC_SIZE,
|
|
DEFAULT_RB_TYPE);
|
|
DEFAULT_RB_TYPE);
|
|
if(raw_block != NULL) {
|
|
if(raw_block != NULL) {
|
|
- LOCK_GLOBAL();
|
|
|
|
- LOCK_RAW_BLOCK(raw_block);
|
|
|
|
SLIST_INSERT_HEAD(&tls_allocator->rb_head, raw_block, pointers);
|
|
SLIST_INSERT_HEAD(&tls_allocator->rb_head, raw_block, pointers);
|
|
- UNLOCK_GLOBAL();
|
|
|
|
|
|
|
|
encapsulated_rb = (DEFAULT_RB_T *)
|
|
encapsulated_rb = (DEFAULT_RB_T *)
|
|
((uintptr_t) raw_block + sizeof(raw_block_header_t));
|
|
((uintptr_t) raw_block + sizeof(raw_block_header_t));
|
|
memptr = freelist_memalign(encapsulated_rb, alignment, size);
|
|
memptr = freelist_memalign(encapsulated_rb, alignment, size);
|
|
- UNLOCK_RAW_BLOCK(raw_block);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else { /* A big block has to be created */
|
|
} else { /* A big block has to be created */
|