void * skynet_realloc(void *ptr, size_t size) { if (ptr == NULL) return skynet_malloc(size); void* rawptr = clean_prefix(ptr); void *newptr = je_realloc(rawptr, size+PREFIX_SIZE); if(!newptr) malloc_oom(size); return fill_prefix(newptr); }
void * skynet_calloc(size_t nmemb,size_t size) { void* ptr = je_calloc(nmemb + ((PREFIX_SIZE+size-1)/size), size ); if(!ptr) malloc_oom(size); return fill_prefix(ptr); }
void * skynet_malloc(size_t size) { void* ptr = je_malloc(size + PREFIX_SIZE); if(!ptr) malloc_oom(size); return fill_prefix(ptr); }
void * skynet_memalign(size_t alignment, size_t size) { void* ptr = je_memalign(alignment, size + PREFIX_SIZE); if(!ptr) malloc_oom(size); return fill_prefix(ptr); }