hook aligned_alloc

This commit is contained in:
Cloud Wu
2018-07-20 14:46:53 +08:00
parent ea7c6402dd
commit 16f060f864
2 changed files with 9 additions and 0 deletions

View File

@@ -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