Sfink/Contexts and Compartments: Difference between revisions

No edit summary
Line 7: Line 7:
JSContexts are control, JSCompartments are data.
JSContexts are control, JSCompartments are data.


A JSContext (from here on, just ''context'') represents the execution of JS code. A context contains a JS stack and is associated with a thread. (A thread may use multiple contexts, but a given context will only execute on a single thread at a time.)
A JSContext (from here on, just ''context'') represents the execution of JS code. A context contains a JS stack and is associated with a thread. A thread may use multiple contexts, but a given context will only execute on a single thread at a time.


A JSCompartment (''compartment'') is a memory space that objects and other garbage-collected things (''GCthings'') are stored within.
A JSCompartment (''compartment'') is a memory space that objects and other garbage-collected things (''GCthings'') are stored within.
Confirmed users
328

edits