~ubuntu-branches/ubuntu/quantal/libgc/quantal

« back to all changes in this revision

Viewing changes to include/gc_allocator.h

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2011-02-19 12:19:56 UTC
  • mfrom: (1.3.2 upstream) (0.1.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110219121956-67rb69xlt5nud3v2
Tags: 1:7.1-5
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#define GC_ALLOCATOR_H
41
41
 
42
42
#include "gc.h"
 
43
#include <new> // for placement new
43
44
 
44
45
#if defined(__GNUC__)
45
46
#  define GC_ATTR_UNUSED __attribute__((unused))
64
65
# define GC_DECLARE_PTRFREE(T) \
65
66
template<> struct GC_type_traits<T> { GC_true_type GC_is_ptr_free; }
66
67
 
 
68
GC_DECLARE_PTRFREE(char);
67
69
GC_DECLARE_PTRFREE(signed char);
68
70
GC_DECLARE_PTRFREE(unsigned char);
69
71
GC_DECLARE_PTRFREE(signed short);
74
76
GC_DECLARE_PTRFREE(unsigned long);
75
77
GC_DECLARE_PTRFREE(float);
76
78
GC_DECLARE_PTRFREE(double);
 
79
GC_DECLARE_PTRFREE(long double);
77
80
/* The client may want to add others.   */
78
81
 
79
82
// In the following GC_Tp is GC_true_type iff we are allocating a
106
109
  };
107
110
 
108
111
  gc_allocator()  {}
109
 
# ifndef _MSC_VER
110
 
    // I'm not sure why this is needed here in addition to the following.
111
 
    // The standard specifies it for the standard allocator, but VC++ rejects
112
 
    // it.      -HB
113
112
    gc_allocator(const gc_allocator&) throw() {}
114
 
# endif
 
113
# if !(GC_NO_MEMBER_TEMPLATES || 0 < _MSC_VER && _MSC_VER <= 1200)
 
114
  // MSVC++ 6.0 do not support member templates
115
115
  template <class GC_Tp1> gc_allocator(const gc_allocator<GC_Tp1>&) throw() {}
 
116
# endif
116
117
  ~gc_allocator() throw() {}
117
118
 
118
119
  pointer address(reference GC_x) const { return &GC_x; }
187
188
  };
188
189
 
189
190
  traceable_allocator() throw() {}
190
 
# ifndef _MSC_VER
191
191
    traceable_allocator(const traceable_allocator&) throw() {}
192
 
# endif
 
192
# if !(GC_NO_MEMBER_TEMPLATES || 0 < _MSC_VER && _MSC_VER <= 1200)
 
193
  // MSVC++ 6.0 do not support member templates
193
194
  template <class GC_Tp1> traceable_allocator
194
195
          (const traceable_allocator<GC_Tp1>&) throw() {}
 
196
# endif
195
197
  ~traceable_allocator() throw() {}
196
198
 
197
199
  pointer address(reference GC_x) const { return &GC_x; }