Classes | Public Member Functions | Static Public Member Functions | Friends

v8::HandleScope Class Reference

#include <v8.h>

List of all members.

Classes

class  Data

Public Member Functions

template<class T >
Local< T > Close (Handle< T > value)

Static Public Member Functions

static int NumberOfHandles ()
static internal::Object ** CreateHandle (internal::Object *value)
static internal::Object ** CreateHandle (internal::HeapObject *value)

Friends

class ImplementationUtilities

Detailed Description

A stack-allocated class that governs a number of local handles. After a handle scope has been created, all local handles will be allocated within that handle scope until either the handle scope is deleted or another handle scope is created. If there is already a handle scope and a new one is created, all allocations will take place in the new handle scope until it is deleted. After that, new handles will again be allocated in the original handle scope.

After the handle scope of a local handle has been deleted the garbage collector will no longer track the object stored in the handle and may deallocate it. The behavior of accessing a handle for which the handle scope has been deleted is undefined.


Member Function Documentation

template<class T >
Local< T > v8::HandleScope::Close ( Handle< T >  value  ) 

Closes the handle scope and returns the value as a handle in the previous scope, which is the new current scope after the call.

static internal::Object** v8::HandleScope::CreateHandle ( internal::Object *  value  )  [static]

Creates a new handle with the given value.

Referenced by v8::Local< T >::New().

static int v8::HandleScope::NumberOfHandles (  )  [static]

Counts the number of allocated handles.


The documentation for this class was generated from the following file: