Mercurial > hg > octave-nkf
diff liboctave/oct-alloc.h @ 3219:30770ba4457a
[project @ 1998-11-13 03:44:31 by jwe]
author | jwe |
---|---|
date | Fri, 13 Nov 1998 03:44:36 +0000 |
parents | 8b262e771614 |
children | 23d06c9e1edd |
line wrap: on
line diff
--- a/liboctave/oct-alloc.h +++ b/liboctave/oct-alloc.h @@ -59,6 +59,19 @@ bool grow (void); }; +#define DECLARE_OCTAVE_ALLOCATOR \ + public: \ + void *operator new (size_t size) { return allocator.alloc (size); } \ + void operator delete (void *p, size_t size) { allocator.free (p, size); } \ + private: \ + static octave_allocator allocator; + +#define DEFINE_OCTAVE_ALLOCATOR(t) \ + octave_allocator t::allocator (sizeof (t)) + +#define DEFINE_OCTAVE_ALLOCATOR2(t, s) \ + octave_allocator t::allocator (sizeof (t), s) + #endif /*