API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

JSONGENREALLOCFUNC

Brew Release
Brew MP 1.0.2
Description
Function to allocate/reallocate/free memory. The basic functionality is similar to the standard C library realloc() function.
A new allocation is done by reallocating a NULL pointer to the desired size.
Freeing an allocated block is done by reallocating the block to size zero (0).
A reallocation is done by reallocating a valid pointer to the desired size.
Params
pvCtx
[]:
Context as provided in the Ctor()
nSize
[]:
the requested new size of the block, or zero (0) to request that the block be freed.
ppOut
[]:
(in/out) on entry, *ppOut should have the existing pointer (for reallocation) or NULL (for new allocation) to the block; on exit, *ppOut will have the new pointer to the block, or NULL if a block was freed. On failure, *ppOut is unchanged.
Prototype
  •    int (* JSONGenReallocFunc)(void *pvCtx, int nSize, void **ppOut);
    
Return
  • JSONGEN_SUCCESS - Allocation (or free) was successful or other error code