| ||||||||||||
SummaryReallocates a region of memory. | ||||||||||||
Syntaxvoid * JS_realloc(JSContext *cx, void *p, size_t nbytes);
| ||||||||||||
DescriptionJS_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.
| ||||||||||||
NotesCurrentlyJS_realloc is a wrapper on the standard C realloc call. Do not make assumptions based on this underlying reliance. Future versions of JS_realloc may be implemented in a different manner.
If
If a reallocation request fails,
Whenever the pointer returned by
| ||||||||||||
See Also
|