AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Entry:     JS_GC (Function)
Summary:     Performs garbage collection in the JS memory pool.
Syntax:
void JS_GC(JSContext *cx);

Description:
JS_GC performs garbage collection, if necessary, of JS objects, doubles, and strings that are no longer needed by a script executing in a specified JSContextcx. Garbage collection frees space in the memory pool so that it can be reused by the JS engine.

When you use JS_malloc and JS_realloc to allocate memory for executable script contexts, these routines automatically invoke the garbage collection routine.

When your scripts create many objects, you may want to call JS_GC directly in your code, particularly when request ends or a script terminates. To run garbage collection only when a certain amount of memory has been allocated, you can call JS_MaybeGC instead of JS_GC.


See also:
JS_MaybeGC
JS_malloc
JS_realloc

[sh-index] Back to list of manuals