carbReallocate
Defined in carb/Memory.h
- 
void *carbReallocate(void *p, size_t size, size_t align)
- Internal function used by all other allocation functions. - This function is the entry point into - carb.dll/- libcarb.sofor carb::allocate(), carb::deallocate(), and carb::reallocate(). There are four modes to this function:- If - pis- nullptrand- sizeis- 0, no action is taken and- nullptris returned.
- If - pis not- nullptrand- sizeis- 0, the given pointer is deallocated and- nullptris returned.
- If - pis- nullptrand- sizeis non-zero, memory of the requested- sizeand alignment specified by- alignis allocated and returned. If an allocation error occurs,- nullptris returned.
- If - pis not- nullptrand- 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,- nullptris returned.
 - Note - Using this function requires explicitly linking with - carb.dll/- libcarb.soif CARB_REQUIRE_LINKED is- 1. Otherwise, the caller must ensure that- carb.dll/- 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.- Warning - Do not call this function directly. Instead call carb::allocate(), carb::deallocate(), or carb::reallocate() - Parameters
- 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. 
 
- Returns
- Allocated memory, or - nullptrupon deallocation, or- nullptron allocation when an error occurs.