On Wed, Aug 21, 2013 at 1:38 AM, Luke <[email protected]> wrote:
> Ok, so I probably have to stick with Persistent then.
>
> What I was wondering was is the value itself stored differently (stack vs
> heap) depending on whether the handle is Persistent or not? Is the only
> difference that Persistent is not collected?

JS values are never stored on the stack (with the C++ API anyway,
unless it's an integer that fits in a SMI - but I digress.)

A Handle<T> or a Local<T> is basically a pointer to an object on the
JS heap.  A Persistent<T> is a pointer too but it's also an artificial
GC root.  That's what keeps the garbage collector from collecting it -
from the perspective of the garbage collector, there is always a
reference to the object.

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to