--- deliantra/server/common/utils.C 2006/09/12 19:20:06 1.11 +++ deliantra/server/common/utils.C 2006/09/14 22:34:00 1.15 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_utils_c = - * "$Id: utils.C,v 1.11 2006/09/12 19:20:06 root Exp $"; - */ - /* CrossFire, A Multiplayer game for X-windows @@ -24,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - The authors can be reached via e-mail at crossfire-devel@real-time.com + The authors can be reached via e-mail at */ /* @@ -551,39 +545,16 @@ return; } -void * -zero_initialised::operator new (size_t s, void *p) -{ - memset (p, 0, s); - return p; -} +///////////////////////////////////////////////////////////////////////////// -void * -zero_initialised::operator new (size_t s) +void *alloc (int s) throw (std::bad_alloc) { - //return calloc (1, s); - return g_slice_alloc0 (s); -} + void *p = g_slice_alloc (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 (!p) + throw std::bad_alloc (); -void -zero_initialised::operator delete[] (void *p, size_t s) -{ - //free (p); return; - g_slice_free1 (s, p); + return p; } void assign (char *dst, const char *src, int maxlen)