>
>
> Right now the largest pain is needing to Local<T>::New() the 
> Persistent<T>* passed to the MakeWeak callback so we can access external 
> memory attached via Object::SetIndexedPropertiesToExternalArrayData().
>
>
Okay, that's good, as we have a fix already lined up for that problem.
 

> As for using reinterpret_cast<Local*>, will that be a long-er term 
> solution for problems like the following:
>
> void CallMe(const FunctionCallbackInfo<Value>& args) {
>   HandleScope scope(args.GetCurrentIsolate());
>   // storing and passing a cached empty object is the fastest way I've 
> found
>   // to call a js fn from cc
>   
> ToLocal<Function>(&p_call_this_often)->Call(ToLocal<Object>(&p_empty_obj), 
> argc, argv);
> }
>

Unfortunately, I'm not sure there's much we can ultimately do about that. 
 If you have Persistents that are not weak, am I'm assuming these ones 
aren't, then the casting is at least safe to do.  It might be good to add a 
debug ASSERT to your ToLocal function that check that the persistent passed 
is never weak as well as a AssertNoGCScope around the code that uses a 
casted Persistent.

Right now they'd be:
> - Object::HasIndexedPropertiesInExternalArrayData()
> - Object::GetIndexedPropertiesExternalArrayData()
> - Object::GetIndexedPropertiesExternalArrayDataLength()
>

All those functions don't allocate heap memory, so we may be able to 
provide persistent versions of those if absolutely necessary.  If our fix 
to the weak callbacks removes the need to have those in v8.h, then we'd 
like not to add a second version of them to the api.

-- 
-- 
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