Back to index

plt-scheme  4.2.1
Classes | Public Types | Public Member Functions
gc_allocator< GC_Tp > Class Template Reference

#include <gc_allocator.h>

List of all members.

Classes

struct  rebind

Public Types

typedef size_t size_type
typedef ptrdiff_t difference_type
typedef GC_Tp * pointer
typedef const GC_Tp * const_pointer
typedef GC_Tp & reference
typedef const GC_Tp & const_reference
typedef GC_Tp value_type

Public Member Functions

 gc_allocator ()
 gc_allocator (const gc_allocator &) throw ()
template<class GC_Tp1 >
 gc_allocator (const gc_allocator< GC_Tp1 > &) throw ()
 ~gc_allocator () throw ()
pointer address (reference GC_x) const
const_pointer address (const_reference GC_x) const
GC_Tp * allocate (size_type GC_n, const void *=0)
void deallocate (pointer __p, size_type GC_ATTR_UNUSED GC_n)
size_type max_size () const throw ()
void construct (pointer __p, const GC_Tp &__val)
void destroy (pointer __p)

Detailed Description

template<class GC_Tp>
class gc_allocator< GC_Tp >

Definition at line 94 of file gc_allocator.h.


Member Typedef Documentation

template<class GC_Tp>
typedef const GC_Tp* gc_allocator< GC_Tp >::const_pointer

Definition at line 99 of file gc_allocator.h.

template<class GC_Tp>
typedef const GC_Tp& gc_allocator< GC_Tp >::const_reference

Definition at line 101 of file gc_allocator.h.

template<class GC_Tp>
typedef ptrdiff_t gc_allocator< GC_Tp >::difference_type

Definition at line 97 of file gc_allocator.h.

template<class GC_Tp>
typedef GC_Tp* gc_allocator< GC_Tp >::pointer

Definition at line 98 of file gc_allocator.h.

template<class GC_Tp>
typedef GC_Tp& gc_allocator< GC_Tp >::reference

Definition at line 100 of file gc_allocator.h.

template<class GC_Tp>
typedef size_t gc_allocator< GC_Tp >::size_type

Definition at line 96 of file gc_allocator.h.

template<class GC_Tp>
typedef GC_Tp gc_allocator< GC_Tp >::value_type

Definition at line 102 of file gc_allocator.h.


Constructor & Destructor Documentation

template<class GC_Tp>
gc_allocator< GC_Tp >::gc_allocator ( ) [inline]

Definition at line 108 of file gc_allocator.h.

{}
template<class GC_Tp>
gc_allocator< GC_Tp >::gc_allocator ( const gc_allocator< GC_Tp > &  ) throw () [inline]

Definition at line 113 of file gc_allocator.h.

{}
template<class GC_Tp>
template<class GC_Tp1 >
gc_allocator< GC_Tp >::gc_allocator ( const gc_allocator< GC_Tp1 > &  ) throw () [inline]

Definition at line 115 of file gc_allocator.h.

{}
template<class GC_Tp>
gc_allocator< GC_Tp >::~gc_allocator ( ) throw () [inline]

Definition at line 116 of file gc_allocator.h.

{}

Member Function Documentation

template<class GC_Tp>
pointer gc_allocator< GC_Tp >::address ( reference  GC_x) const [inline]

Definition at line 118 of file gc_allocator.h.

{ return &GC_x; }
template<class GC_Tp>
const_pointer gc_allocator< GC_Tp >::address ( const_reference  GC_x) const [inline]

Definition at line 119 of file gc_allocator.h.

{ return &GC_x; }
template<class GC_Tp>
GC_Tp* gc_allocator< GC_Tp >::allocate ( size_type  GC_n,
const void = 0 
) [inline]

Definition at line 123 of file gc_allocator.h.

                                                   {
    GC_type_traits<GC_Tp> traits;
    return static_cast<GC_Tp *>
           (GC_selective_alloc(GC_n * sizeof(GC_Tp),
                             traits.GC_is_ptr_free));
  }

Here is the call graph for this function:

template<class GC_Tp>
void gc_allocator< GC_Tp >::construct ( pointer  __p,
const GC_Tp &  __val 
) [inline]

Definition at line 137 of file gc_allocator.h.

{ new(__p) GC_Tp(__val); }
template<class GC_Tp>
void gc_allocator< GC_Tp >::deallocate ( pointer  __p,
size_type GC_ATTR_UNUSED  GC_n 
) [inline]

Definition at line 131 of file gc_allocator.h.

    { GC_FREE(__p); }
template<class GC_Tp>
void gc_allocator< GC_Tp >::destroy ( pointer  __p) [inline]

Definition at line 138 of file gc_allocator.h.

{ __p->~GC_Tp(); }
template<class GC_Tp>
size_type gc_allocator< GC_Tp >::max_size ( ) const throw () [inline]

Definition at line 134 of file gc_allocator.h.

    { return size_t(-1) / sizeof(GC_Tp); }

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