ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/utils.C
(Generate patch)

Comparing deliantra/server/common/utils.C (file contents):
Revision 1.11 by root, Tue Sep 12 19:20:06 2006 UTC vs.
Revision 1.12 by root, Tue Sep 12 20:55:40 2006 UTC

1 1
2/* 2/*
3 * static char *rcsid_utils_c = 3 * static char *rcsid_utils_c =
4 * "$Id: utils.C,v 1.11 2006/09/12 19:20:06 root Exp $"; 4 * "$Id: utils.C,v 1.12 2006/09/12 20:55:40 root Exp $";
5 */ 5 */
6 6
7/* 7/*
8 CrossFire, A Multiplayer game for X-windows 8 CrossFire, A Multiplayer game for X-windows
9 9
549 strcpy (input, tmp); 549 strcpy (input, tmp);
550 550
551 return; 551 return;
552} 552}
553 553
554void * 554void *alloc (int s) throw (std::bad_alloc)
555zero_initialised::operator new (size_t s, void *p)
556{ 555{
557 memset (p, 0, s); 556 if (s)
558 return p;
559}
560
561void *
562zero_initialised::operator new (size_t s)
563{
564 //return calloc (1, s);
565 return g_slice_alloc0 (s); 557 return g_slice_alloc (s);
558 else
559 return 0;
566} 560}
567 561
568void * 562void dealloc (void *p, int s) throw ()
569 zero_initialised::operator new[] (size_t s)
570{ 563{
571 //return calloc (1, s); 564 if (s)
572 return g_slice_alloc0 (s);
573}
574
575void
576zero_initialised::operator delete (void *p, size_t s)
577{
578 //free (p); return;
579 g_slice_free1 (s, p); 565 g_slice_free1 (s, p);
580}
581
582void
583zero_initialised::operator delete[] (void *p, size_t s)
584{
585 //free (p); return;
586 g_slice_free1 (s, p);
587} 566}
588 567
589void assign (char *dst, const char *src, int maxlen) 568void assign (char *dst, const char *src, int maxlen)
590{ 569{
591 if (!src) 570 if (!src)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines