ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/util.h
(Generate patch)

Comparing deliantra/server/include/util.h (file contents):
Revision 1.20 by root, Sun Dec 17 23:10:35 2006 UTC vs.
Revision 1.21 by root, Thu Dec 21 06:12:36 2006 UTC

53 53
54// also copies src into the new area, like "memdup" 54// also copies src into the new area, like "memdup"
55// if src is 0, clears the memory 55// if src is 0, clears the memory
56template<typename T> 56template<typename T>
57inline T *salloc (int n, T *src) throw (std::bad_alloc) { return (T *)salloc_ (n * sizeof (T), (void *)src); } 57inline T *salloc (int n, T *src) throw (std::bad_alloc) { return (T *)salloc_ (n * sizeof (T), (void *)src); }
58
59// clears the memory
60template<typename T>
61inline T *salloc0(int n = 1) throw (std::bad_alloc) { return (T *)salloc_ (n * sizeof (T), 0); }
58 62
59// for symmetry 63// for symmetry
60template<typename T> 64template<typename T>
61inline void sfree (T *ptr, int n = 1) throw () 65inline void sfree (T *ptr, int n = 1) throw ()
62{ 66{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines