diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2011-09-10 16:12:07 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2011-09-10 16:12:07 -0700 |
commit | f841b6fdcc802e73d52da0e67ee192c0c2c1c7e1 (patch) | |
tree | d9b013ab252968ec1e90e721f7b2ab819af0acb0 /src/common/malloc.c | |
parent | 5939e1bec75f2550d3ce109b9cd9a5d22c0626c2 (diff) | |
parent | 723fb5d3431b847526c433a13aa74485cfb564a3 (diff) | |
download | tmwa-f841b6fdcc802e73d52da0e67ee192c0c2c1c7e1.tar.gz tmwa-f841b6fdcc802e73d52da0e67ee192c0c2c1c7e1.tar.bz2 tmwa-f841b6fdcc802e73d52da0e67ee192c0c2c1c7e1.tar.xz tmwa-f841b6fdcc802e73d52da0e67ee192c0c2c1c7e1.zip |
Merge commit '723fb5d3431b847526c433a13aa74485cfb564a3'
Diffstat (limited to 'src/common/malloc.c')
-rw-r--r-- | src/common/malloc.c | 68 |
1 files changed, 0 insertions, 68 deletions
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 <stdio.h> -#include <stdlib.h> -#include <string.h> -#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; -} |