V8 Project
v8::internal::zone_allocator< T > Class Template Reference

#include <zone-allocator.h>

+ Collaboration diagram for v8::internal::zone_allocator< T >:

Classes

struct  rebind
 

Public Types

typedef Tpointer
 
typedef const Tconst_pointer
 
typedef Treference
 
typedef const Tconst_reference
 
typedef T value_type
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 

Public Member Functions

 zone_allocator (Zone *zone) throw ()
 
 zone_allocator (const zone_allocator &other) throw ()
 
template<typename U >
 zone_allocator (const zone_allocator< U > &other) throw ()
 
pointer address (reference x) const
 
const_pointer address (const_reference x) const
 
pointer allocate (size_type n, const void *hint=0)
 
void deallocate (pointer p, size_type)
 
size_type max_size () const throw ()
 
void construct (pointer p, const T &val)
 
void destroy (pointer p)
 
bool operator== (zone_allocator const &other)
 
bool operator!= (zone_allocator const &other)
 

Private Member Functions

 zone_allocator ()
 

Private Attributes

Zonezone_
 

Friends

template<typename U >
class zone_allocator
 

Detailed Description

template<typename T>
class v8::internal::zone_allocator< T >

Definition at line 16 of file zone-allocator.h.

Member Typedef Documentation

◆ const_pointer

template<typename T >
typedef const T* v8::internal::zone_allocator< T >::const_pointer

Definition at line 19 of file zone-allocator.h.

◆ const_reference

template<typename T >
typedef const T& v8::internal::zone_allocator< T >::const_reference

Definition at line 21 of file zone-allocator.h.

◆ difference_type

template<typename T >
typedef ptrdiff_t v8::internal::zone_allocator< T >::difference_type

Definition at line 24 of file zone-allocator.h.

◆ pointer

template<typename T >
typedef T* v8::internal::zone_allocator< T >::pointer

Definition at line 18 of file zone-allocator.h.

◆ reference

template<typename T >
typedef T& v8::internal::zone_allocator< T >::reference

Definition at line 20 of file zone-allocator.h.

◆ size_type

template<typename T >
typedef size_t v8::internal::zone_allocator< T >::size_type

Definition at line 23 of file zone-allocator.h.

◆ value_type

template<typename T >
typedef T v8::internal::zone_allocator< T >::value_type

Definition at line 22 of file zone-allocator.h.

Constructor & Destructor Documentation

◆ zone_allocator() [1/4]

template<typename T >
v8::internal::zone_allocator< T >::zone_allocator ( Zone zone)
throw (
)
inlineexplicit

Definition at line 29 of file zone-allocator.h.

29 : zone_(zone) {}

◆ zone_allocator() [2/4]

template<typename T >
v8::internal::zone_allocator< T >::zone_allocator ( const zone_allocator< T > &  other)
throw (
)
inlineexplicit

Definition at line 30 of file zone-allocator.h.

31  : zone_(other.zone_) {}

◆ zone_allocator() [3/4]

template<typename T >
template<typename U >
v8::internal::zone_allocator< T >::zone_allocator ( const zone_allocator< U > &  other)
throw (
)
inline

Definition at line 32 of file zone-allocator.h.

33  : zone_(other.zone_) {}

◆ zone_allocator() [4/4]

template<typename T >
v8::internal::zone_allocator< T >::zone_allocator ( )
private

Member Function Documentation

◆ address() [1/2]

template<typename T >
const_pointer v8::internal::zone_allocator< T >::address ( const_reference  x) const
inline

Definition at line 37 of file zone-allocator.h.

37 {return &x;}

◆ address() [2/2]

template<typename T >
pointer v8::internal::zone_allocator< T >::address ( reference  x) const
inline

Definition at line 36 of file zone-allocator.h.

36 {return &x;}

◆ allocate()

template<typename T >
pointer v8::internal::zone_allocator< T >::allocate ( size_type  n,
const void *  hint = 0 
)
inline

Definition at line 39 of file zone-allocator.h.

39  {
40  return static_cast<pointer>(zone_->NewArray<value_type>(
41  static_cast<int>(n)));
42  }
T * NewArray(int length)
Definition: zone.h:46

References v8::internal::Zone::NewArray(), and v8::internal::zone_allocator< T >::zone_.

+ Here is the call graph for this function:

◆ construct()

template<typename T >
void v8::internal::zone_allocator< T >::construct ( pointer  p,
const T val 
)
inline

Definition at line 48 of file zone-allocator.h.

48  {
49  new(static_cast<void*>(p)) T(val);
50  }
#define T(name, string, precedence)
Definition: token.cc:25

References T.

◆ deallocate()

template<typename T >
void v8::internal::zone_allocator< T >::deallocate ( pointer  p,
size_type   
)
inline

Definition at line 43 of file zone-allocator.h.

43 { /* noop for Zones */ }

◆ destroy()

template<typename T >
void v8::internal::zone_allocator< T >::destroy ( pointer  p)
inline

Definition at line 51 of file zone-allocator.h.

51 { p->~T(); }

◆ max_size()

template<typename T >
size_type v8::internal::zone_allocator< T >::max_size ( ) const
throw (
)
inline

Definition at line 45 of file zone-allocator.h.

45  {
46  return std::numeric_limits<int>::max() / sizeof(value_type);
47  }

◆ operator!=()

template<typename T >
bool v8::internal::zone_allocator< T >::operator!= ( zone_allocator< T > const &  other)
inline

Definition at line 56 of file zone-allocator.h.

56  {
57  return zone_ != other.zone_;
58  }

References v8::internal::zone_allocator< T >::zone_.

◆ operator==()

template<typename T >
bool v8::internal::zone_allocator< T >::operator== ( zone_allocator< T > const &  other)
inline

Definition at line 53 of file zone-allocator.h.

53  {
54  return zone_ == other.zone_;
55  }

References v8::internal::zone_allocator< T >::zone_.

Friends And Related Function Documentation

◆ zone_allocator

template<typename T >
template<typename U >
friend class zone_allocator
friend

Definition at line 34 of file zone-allocator.h.

Member Data Documentation

◆ zone_


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