Entry: JS_malloc (Function)
Summary: Allocates a region of memory for use.
Syntax:
void * JS_malloc(JSContext *cx, size_t nbytes);
Argument Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
nbytes size_t Amount of space, in bytes, to allocate.
Description:
JS_malloc allocates a region of memory nbytes in size. If the allocation is successful, JS_malloc returns a pointer to the beginning of the region.
If the memory cannot be allocated, JS_malloc passes cx to JS_ReportOutOfMemory to report the error, and returns a null pointer.
As with a standard C call to malloc, the region of memory allocated by this call is uninitialized and should be assumed to contain meaningless information.
See also:
|
|
|