#include <oskit/com/mem.h>void *oskit_mem_realloc(oskit_mem_t *m, void *ptr, oskit_u32_t oldsize, oskit_u32_t newsize, oskit_u32_t flags);
Change the size of the previously allocated memory chunk referenced by ptr, returning a pointer to the memory chunk. The flags must include OSKIT_MEM_AUTO_SIZE if the original allocation did, otherwise oldsize must properly give the size of the original allocation. If the new size is larger, the contents of the newly allocated portion is undefined. Any other flags specified in the original allocation should necessarily be given as well. If the size of the original chunk cannot be changed in place, a new chunk of the proper size will be allocated, and the contents of the original chunk copied to it.
- m
- The memory object to operate on.
- ptr
- The original memory.
- oldsize
- The size (in bytes) of the original chunk.
- newsize
- The size (in bytes) of the new chunk.
- flags
- Allocation options and constraints.
Returns a pointer to the chunk of memory on success, or NULL if the request could not be satisfied.