Sync usage with man page.
[netbsd-mini2440.git] / gnu / lib / libg++ / g++-include / new.h
blob95d86e02183443bcd5bbd68114d192d6fff7f543
1 #ifndef _new_h
2 #ifdef __GNUG__
3 #pragma once
4 #pragma interface
5 #endif
6 #define _new_h 1
8 #include <stddef.h>
9 #include <std.h>
11 #ifndef NO_LIBGXX_MALLOC
12 #define MALLOC_ALIGN_MASK 7 /* ptrs aligned at 8 byte boundaries */
13 #define MALLOC_MIN_OVERHEAD 8 /* 8 bytes of overhead per pointer */
14 #endif
16 typedef void (*new_handler_t)();
17 extern "C" void default_new_handler();
18 extern "C" new_handler_t set_new_handler(new_handler_t);
20 #ifdef __GNUG__
21 #define NEW(where) new { where }
22 #endif
24 // default placement version of operator new
25 static inline void *operator new(size_t, void *place) { return place; }
27 // provide a C++ interface to vector-resize via realloc
28 static inline void *operator new(size_t size, void *ptr, size_t new_len)
30 return realloc(ptr, new_len * size);
33 #endif