comparison liboctave/oct-alloc.h @ 13838:a35d381e22b0

make octave_allocator optional and disable by default * configure.ac: Provide --enable-octave-allocator option. * oct-alloc.h: Conditionally define OCTAVE_ALLOCATOR macros.
author John W. Eaton <jwe@octave.org>
date Mon, 07 Nov 2011 03:20:10 -0500
parents 1cf28ef2bb88
children 72c96de7a403
comparison
equal deleted inserted replaced
13837:2c80bbd87f5d 13838:a35d381e22b0
70 #define DECLARE_OCTAVE_ALLOCATOR_PLACEMENT_DELETE \ 70 #define DECLARE_OCTAVE_ALLOCATOR_PLACEMENT_DELETE \
71 void operator delete (void *p, void *) \ 71 void operator delete (void *p, void *) \
72 { ::operator delete (p); } 72 { ::operator delete (p); }
73 #endif 73 #endif
74 74
75 #if defined (USE_OCTAVE_ALLOCATOR)
76
75 #define DECLARE_OCTAVE_ALLOCATOR \ 77 #define DECLARE_OCTAVE_ALLOCATOR \
76 public: \ 78 public: \
77 void *operator new (size_t size, void *p) \ 79 void *operator new (size_t size, void *p) \
78 { return ::operator new (size, p); } \ 80 { return ::operator new (size, p); } \
79 DECLARE_OCTAVE_ALLOCATOR_PLACEMENT_DELETE \ 81 DECLARE_OCTAVE_ALLOCATOR_PLACEMENT_DELETE \
86 octave_allocator t::allocator (sizeof (t)) 88 octave_allocator t::allocator (sizeof (t))
87 89
88 #define DEFINE_OCTAVE_ALLOCATOR2(t, s) \ 90 #define DEFINE_OCTAVE_ALLOCATOR2(t, s) \
89 octave_allocator t::allocator (sizeof (t), s) 91 octave_allocator t::allocator (sizeof (t), s)
90 92
93 #else
94
95 #define DECLARE_OCTAVE_ALLOCATOR
96 #define DEFINE_OCTAVE_ALLOCATOR(t)
97 #define DEFINE_OCTAVE_ALLOCATOR2(t, s)
98
91 #endif 99 #endif
100
101 #endif