Defined in carb/Memory.h
void *carbReallocate(void *p, size_t size, size_t align)
Internal function used by all other allocation functions.
0, no action is taken and
0, the given pointer is deallocated and
sizeis non-zero, memory of the requested
sizeand alignment specified by
alignis allocated and returned. If an allocation error occurs,
sizeis non-zero, the memory is reallocated and copied (as if by
std::memcpy) to the new memory block, which is returned. If
pcan be resized in situ, the same
pvalue is returned. If an error occurs,
Using this function requires explicitly linking with
libcarb.soif CARB_REQUIRE_LINKED is
1. Otherwise, the caller must ensure that
libcarb.sois already loaded before calling this function. Use in situations where the Carbonite Framework is already loaded (i.e. plugins) does not require explicitly linking against Carbonite as this function will be found dynamically at runtime.
p – The pointer to re-allocate or free. May be
nullptr. See explanation above.
size – The requested size of the memory region in bytes. See explanation above.
align – The requested alignment of the memory region in bytes. Must be a power of two. See explanation above.
Allocated memory, or
nullptrupon deallocation, or
nullptron allocation when an error occurs.