本文整理汇总了C++中Persistent::ToObject方法的典型用法代码示例。如果您正苦于以下问题:C++ Persistent::ToObject方法的具体用法?C++ Persistent::ToObject怎么用?C++ Persistent::ToObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Persistent
的用法示例。
在下文中一共展示了Persistent::ToObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void
gum_script_event_sink_data_free (Persistent<Value> object,
void * buffer)
{
int32_t size;
HandleScope handle_scope;
size = object->ToObject ()->Get (String::New ("length"))->Uint32Value ();
V8::AdjustAmountOfExternalAllocatedMemory (-size);
g_free (buffer);
object.Dispose ();
}
示例2: object
static void
gum_script_file_on_destroy (Persistent<Value> value,
void * data)
{
(void) data;
HandleScope handle_scope;
Local<Object> object (value->ToObject ());
FILE * file = static_cast<FILE *> (object->GetPointerFromInternalField (0));
if (file != NULL)
fclose (file);
value.Dispose ();
}
示例3: DisposeOpenCLObject
void DisposeOpenCLObject (Persistent<Value> value, void* release) {
if (release && value->IsObject()) {
Local<Object> object = value->ToObject();
if (object->InternalFieldCount()) {
void *ptr = object->GetPointerFromInternalField(0);
int32_t (CALL *clRelease) (void* smth);
*(void**) &clRelease = release;
clRelease(ptr); // Returned value is omitted. Check when debugging.
}
}
value.Dispose();
value.Clear();
}