--- deliantra/server/include/util.h 2006/09/12 20:55:40 1.11 +++ deliantra/server/include/util.h 2006/09/14 00:07:15 1.13 @@ -41,10 +41,13 @@ } }; -void throw_bad_alloc () throw (std::bad_alloc); - +// strictly the same as g_slice_alloc, but never returns 0 void *alloc (int s) throw (std::bad_alloc); -void dealloc (void *p, int s) throw (); +// for symmetry +inline void dealloc (void *p, int s) throw () +{ + g_slice_free1 (s, p); +} // a STL-compatible allocator that uses g_slice // boy, this is verbose @@ -82,7 +85,7 @@ void deallocate (pointer p, size_type n) { - dealloc (static_cast(p), n); + dealloc (static_cast(p), n * sizeof (Tp)); } size_type max_size ()const throw ()