1 | /* |
1 | /* |
2 | * static char *rcsid_utils_c = |
2 | * static char *rcsid_utils_c = |
3 | * "$Id: utils.C,v 1.5 2006/09/07 09:37:12 pippijn Exp $"; |
3 | * "$Id: utils.C,v 1.8 2006/09/09 21:48:28 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
485 | } |
485 | } |
486 | else strcpy(input, tmp); |
486 | else strcpy(input, tmp); |
487 | return; |
487 | return; |
488 | } |
488 | } |
489 | |
489 | |
490 | //TODO: overhead due to specifying size twice |
|
|
491 | void * |
490 | void * |
492 | zero_initialised::operator new (size_t s) |
491 | zero_initialised::operator new (size_t s) |
493 | { |
492 | { |
|
|
493 | //return calloc (1, s); |
494 | return g_slice_alloc0 (s); |
494 | return g_slice_alloc0 (s); |
495 | } |
495 | } |
496 | |
496 | |
497 | void * |
497 | void * |
498 | zero_initialised::operator new [] (size_t s) |
498 | zero_initialised::operator new [] (size_t s) |
499 | { |
499 | { |
|
|
500 | //return calloc (1, s); |
500 | return g_slice_alloc0 (s); |
501 | return g_slice_alloc0 (s); |
501 | } |
502 | } |
502 | |
503 | |
503 | void |
504 | void |
504 | zero_initialised::operator delete (void *p, size_t s) |
505 | zero_initialised::operator delete (void *p, size_t s) |
505 | { |
506 | { |
|
|
507 | //free (p); return; |
506 | g_slice_free1 (s, p); |
508 | g_slice_free1 (s, p); |
507 | } |
509 | } |
508 | |
510 | |
509 | void |
511 | void |
510 | zero_initialised::operator delete [] (void *p, size_t s) |
512 | zero_initialised::operator delete [] (void *p, size_t s) |
511 | { |
513 | { |
|
|
514 | //free (p); return; |
512 | g_slice_free1 (s, p); |
515 | g_slice_free1 (s, p); |
513 | } |
516 | } |
514 | |
517 | |