mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
hook aligned_alloc
This commit is contained in:
@@ -202,6 +202,13 @@ skynet_memalign(size_t alignment, size_t size) {
|
||||
return fill_prefix(ptr);
|
||||
}
|
||||
|
||||
void *
|
||||
skynet_aligned_alloc(size_t alignment, size_t size) {
|
||||
void* ptr = je_aligned_alloc(alignment, size + (PREFIX_SIZE + alignment -1) & ~(alignment-1));
|
||||
if(!ptr) malloc_oom(size);
|
||||
return fill_prefix(ptr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// for skynet_lalloc use
|
||||
|
||||
Reference in New Issue
Block a user