Add wrapper functions for realloc, free and gc, but don't expose them in the

header yet as not all allocators implement them.

svn path=/trunk/; revision=47219
This commit is contained in:
Evan Huus 2013-01-23 00:59:38 +00:00
parent ae61fe0158
commit c25c5915c5
1 changed files with 18 additions and 0 deletions

View File

@ -50,12 +50,30 @@ wmem_alloc0(wmem_allocator_t *allocator, const size_t size)
return memset(buf, 0, size);
}
void *
wmem_realloc(wmem_allocator_t *allocator, void *ptr, const size_t size)
{
return allocator->realloc(allocator->private_data, ptr, size);
}
void
wmem_free(wmem_allocator_t *allocator, void *ptr)
{
allocator->free(allocator->private_data, ptr);
}
void
wmem_free_all(wmem_allocator_t *allocator)
{
allocator->free_all(allocator->private_data);
}
void
wmem_gc(wmem_allocator_t *allocator)
{
allocator->gc(allocator->private_data);
}
void
wmem_destroy_allocator(wmem_allocator_t *allocator)
{