Entry: JS_realloc (Function)
Summary: Reallocates a region of memory.
Syntax:
void * JS_realloc(JSContext *cx, void *p, size_t nbytes);
Argument Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
p void * Pointer to the previously allocated memory
nbytes size_t Amount of space, in bytes, to reallocate.
Description:
JS_realloc reallocates a region of memory, while preserving its contents. Typically you call JS_realloc because you need to allocate more memory than orginally allocated with a call to JS_malloc, but it can also be called to decrease the amount of allocated memory, and even to deallocate the memory region entirely. p is a pointer to the previously allocated memory region, and nbytes is the size, in bytes, of the region to allocate.
See also:
|
|
|