--- deliantra/server/common/utils.C 2006/09/12 19:20:06 1.11 +++ deliantra/server/common/utils.C 2006/09/12 20:55:40 1.12 @@ -1,7 +1,7 @@ /* * static char *rcsid_utils_c = - * "$Id: utils.C,v 1.11 2006/09/12 19:20:06 root Exp $"; + * "$Id: utils.C,v 1.12 2006/09/12 20:55:40 root Exp $"; */ /* @@ -551,39 +551,18 @@ return; } -void * -zero_initialised::operator new (size_t s, void *p) +void *alloc (int s) throw (std::bad_alloc) { - memset (p, 0, s); - return p; -} - -void * -zero_initialised::operator new (size_t s) -{ - //return calloc (1, s); - return g_slice_alloc0 (s); -} - -void * - zero_initialised::operator new[] (size_t s) -{ - //return calloc (1, s); - return g_slice_alloc0 (s); -} - -void -zero_initialised::operator delete (void *p, size_t s) -{ - //free (p); return; - g_slice_free1 (s, p); + if (s) + return g_slice_alloc (s); + else + return 0; } -void -zero_initialised::operator delete[] (void *p, size_t s) +void dealloc (void *p, int s) throw () { - //free (p); return; - g_slice_free1 (s, p); + if (s) + g_slice_free1 (s, p); } void assign (char *dst, const char *src, int maxlen)