Comment #2 on issue 879 by mikhail.naganov: Why does Handle<T>::operator*() return T* instead of T& ?
http://code.google.com/p/v8/issues/detail?id=879

I want to add that you should never work with pointers and refs to V8 objects, but use Handles instead. See the comment around line 160 in include/v8.h:

All objects returned from v8 have to be tracked by the garbage
collector so that it knows that the objects are still alive.  Also,
because the garbage collector may move objects, it is unsafe to
point directly to an object.  Instead, all objects are stored in
handles which are known by the garbage collector and updated
whenever an object moves.  Handles should always be passed by value
(except in cases like out-parameters) and they should never be
allocated on the heap.

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

Reply via email to