On Fri, Aug 5, 2011 at 2:50 AM, Zaheer Ahmad <[email protected]> wrote:

> multiple contexts. Can i just use the Context* from the handle, iam
> guessing thats not GC
>

That's correct - v8 allows the gc to _move_ objects around, meaning the ptrs
are not [guaranteed to be] stable.


> safe. If i stuff Handle<Context> in a structure and pass that, iam guessing
> that would be safe.
>

How could you do that? C cannot compile a template like Handle<Context>, nor
can you hide data inside a C-using struct like you can a C++-using struct.


> Are there other solutions for this pattern.
>

The age-old void-pointer-to-Handle<Context>.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to