--- deliantra/server/common/utils.C 2006/09/12 20:55:40 1.12 +++ deliantra/server/common/utils.C 2006/09/14 01:34:41 1.14 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_utils_c = - * "$Id: utils.C,v 1.12 2006/09/12 20:55:40 root Exp $"; - */ - /* CrossFire, A Multiplayer game for X-windows @@ -551,18 +545,16 @@ return; } +///////////////////////////////////////////////////////////////////////////// + void *alloc (int s) throw (std::bad_alloc) { - if (s) - return g_slice_alloc (s); - else - return 0; -} + void *p = g_slice_alloc (s); -void dealloc (void *p, int s) throw () -{ - if (s) - g_slice_free1 (s, p); + if (!p) + throw std::bad_alloc (); + + return p; } void assign (char *dst, const char *src, int maxlen)