From a2306446c86b3333e69b082e41ae76ba71a42d9d Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 24 Mar 2011 13:57:13 -0700 Subject: Optimize common objects, and adjust other objects accordingly. Major changes still need to be made to each of the servers. --- src/common/malloc.c | 68 ----------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 src/common/malloc.c (limited to 'src/common/malloc.c') diff --git a/src/common/malloc.c b/src/common/malloc.c deleted file mode 100644 index 8d68bee..0000000 --- a/src/common/malloc.c +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include -#include "malloc.h" - -#define SHOW_MEMORY_ERROR(file, line, func, type, msg) \ - fprintf (stderr, "%s:%d: in func %s(): %s() error, %s\n", \ - file, line, func, type, msg) - -void *aMalloc_ (size_t size, const char *file, int line, const char *func) -{ - void *ret = malloc (size); - - /* printf ("%s:%d: in func %s(): malloc(%d)\n", file, line, func, size); */ - if (ret == NULL) - { - SHOW_MEMORY_ERROR (file, line, func, "malloc", "out of memory"); - exit (EXIT_FAILURE); - } - - return ret; -} - -void *aCalloc_ (size_t num, size_t size, const char *file, int line, - const char *func) -{ - void *ret = calloc (num, size); - - /* printf ("%s:%d: in func %s(): calloc(%d, %d)\n", file, line, func, num, - size); */ - if (ret == NULL) - { - SHOW_MEMORY_ERROR (file, line, func, "calloc", "out of memory"); - exit (EXIT_FAILURE); - } - - return ret; -} - -void *aRealloc_ (void *p, size_t size, const char *file, int line, - const char *func) -{ - void *ret = realloc (p, size); - - /* printf ("%s:%d: in func %s(): realloc(%p, %d)\n", file, line, func, p, - size); */ - if (ret == NULL) - { - SHOW_MEMORY_ERROR (file, line, func, "realloc", "out of memory"); - exit (EXIT_FAILURE); - } - - return ret; -} - -char *aStrdup_ (const char *p, const char *file, int line, const char *func) -{ - char *ret = strdup (p); - - /* printf ("%s:%d: in func %s(): strdup(%p)\n", file, line, func, p); */ - if (ret == NULL) - { - SHOW_MEMORY_ERROR (file, line, func, "strdup", "out of memory"); - exit (EXIT_FAILURE); - } - - return ret; -} -- cgit v1.2.3-70-g09d2