I found that the Foreign Class is actually a subclass of HeapObject and
the only difference is that it has some extra size to store a pointer
inside.

So, Can I use a Foreign instance to store a pointer from some C function
and pass it back and forth from/to JS?

>From the code of SetPointerInInternalField I see that's what V8 does if
the pointer cannot be encoded as a SMI. But for the purpose of *just*
sending pointers back and forth, creating an object with an internal
field that ends up having another object on it that actually stores the
address seems overkill, if a Foreign object is a valid JS object, I'd
use that directly.

Thanks,

pablo.

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

Reply via email to