101 T*
alloc(
long unsigned int n);
109 T*
alloc(
long int n);
117 T*
alloc(
unsigned int n);
136 void free(T*
b,
long unsigned int n);
147 void free(T* b,
long int n);
158 void free(T* b,
unsigned int n);
169 void free(T* b,
int n);
182 T*
realloc(T* b,
long unsigned int n,
long unsigned int m);
195 T*
realloc(T* b,
long int n,
long int m);
208 T*
realloc(T* b,
unsigned int n,
unsigned int m);
221 T*
realloc(T* b,
int n,
int m);
233 void rfree(
void* p,
size_t s);
247 template<
class T,
typename A1>
254 template<
class T,
typename A1,
typename A2>
255 T&
construct(A1
const& a1, A2
const& a2);
261 template<
class T,
typename A1,
typename A2,
typename A3>
262 T&
construct(A1
const& a1, A2
const& a2, A3
const& a3);
268 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4>
269 T&
construct(A1
const& a1, A2
const& a2, A3
const& a3, A4
const& a4);
275 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
276 T&
construct(A1
const& a1, A2
const& a2, A3
const& a3, A4
const& a4, A5
const& a5);
282 static void*
operator new(
size_t s)
throw() { (void) s;
return NULL; }
284 static void operator delete(
void* p) { (void) p; };
288 const Region& operator =(
const Region&) {
return *
this; }
299 : home(const_cast<
Space&>(h)), free_reset(home.sm->region.free), hi(0) {}
306 return heap_alloc(s);
314 home.sm->region.
free = free_reset;
327 T* p =
static_cast<T*
>(
ralloc(
sizeof(T)*n));
328 for (
long unsigned int i=n;
i--; )
329 (
void)
new (p+
i) T();
336 return alloc<T>(
static_cast<long unsigned int>(n));
341 return alloc<T>(
static_cast<long unsigned int>(n));
347 return alloc<T>(
static_cast<long unsigned int>(n));
353 for (
long unsigned int i=n;
i--; )
355 rfree(b,n*
sizeof(T));
361 free<T>(
b,
static_cast<long unsigned int>(n));
366 free<T>(
b,
static_cast<long unsigned int>(n));
372 free<T>(
b,
static_cast<long unsigned int>(n));
379 T* p =
static_cast<T*
>(
ralloc(
sizeof(T)*m));
380 for (
long unsigned int i=n;
i--; )
381 (
void)
new (p+
i) T(b[
i]);
382 for (
long unsigned int i=n; i<
m; i++)
383 (
void)
new (p+
i) T();
394 assert((n >= 0) && (m >= 0));
395 return realloc<T>(
b,
static_cast<long unsigned int>(n),
396 static_cast<long unsigned int>(m));
401 return realloc<T>(
b,
static_cast<long unsigned int>(n),
402 static_cast<long unsigned int>(m));
407 assert((n >= 0) && (m >= 0));
408 return realloc<T>(
b,
static_cast<long unsigned int>(n),
409 static_cast<long unsigned int>(m));
421 template<
class T,
typename A1>
424 T& t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
428 template<
class T,
typename A1,
typename A2>
431 T& t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
435 template<
class T,
typename A1,
typename A2,
typename A3>
438 T& t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
439 new (&t) T(a1,a2,a3);
442 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4>
445 T& t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
446 new (&t) T(a1,a2,a3,a4);
449 template<
class T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
452 T& t = *
static_cast<T*
>(
ralloc(
sizeof(T)));
453 new (&t) T(a1,a2,a3,a4,a5);