Implemented a new system to provide a context-specific global rooted object
authorMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 5 Oct 2006 18:43:38 +0000 (18:43 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 5 Oct 2006 18:43:38 +0000 (18:43 +0000)
commite0ce3635864c4dc04663321544988b584bf69886
tree26e15edb81d860fb1c45a11e283edca22b3a4b8c
parenta594bd4063c62381fc6789f829f6838636b372e5
Implemented a new system to provide a context-specific global rooted object
on which other casses may attach arbitrary objects which should not be sweaped
away by the garbage collector.

Although the system clobbers context-specific user data pointer by using
JS_GetContextPrivate() and JS_SetContextPrivate(), it also exports two
functions to perform the same functionality if it was required:
js_GCRoot_udata_get() and js_GCRoot_udata_set().

It is important to call js_InitGCRoot() after JS_NewContext() and to
call js_DestroyGCRoot() before JS_DestroyContext() in applications which
depend on this library (such as js_pgsql.[ch]).
mmsoftware/js/classes/js_gcroot.c
mmsoftware/js/classes/js_gcroot.h
mmsoftware/js/classes/js_pgsql.c
mmsoftware/js/js-appserv/src/GNUmakefile
mmsoftware/js/js-appserv/src/js-appserv.c
mmsoftware/js/js-sh/src/GNUmakefile
mmsoftware/js/js-sh/src/js-sh.c