diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-12-23 19:53:04 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-12-23 21:02:33 +0100 |
commit | 950e6c9148eca244a89d18a21d4ae4e5c3d1c646 (patch) | |
tree | 8664cf3156b92e4083e0680a0a1f21e20a2b22c9 /src/utils/mem.c | |
parent | b75293a565b6f319435516fe253bd61688ba3a1f (diff) | |
download | blogc-950e6c9148eca244a89d18a21d4ae4e5c3d1c646.tar.gz blogc-950e6c9148eca244a89d18a21d4ae4e5c3d1c646.tar.bz2 blogc-950e6c9148eca244a89d18a21d4ae4e5c3d1c646.zip |
build: removing src/utils and replacing with squareball
squareball is a new general purpose library for C99, based on the code
removed from src/utils
Diffstat (limited to 'src/utils/mem.c')
-rw-r--r-- | src/utils/mem.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/utils/mem.c b/src/utils/mem.c deleted file mode 100644 index 7c5e0a2..0000000 --- a/src/utils/mem.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * blogc: A blog compiler. - * Copyright (C) 2014-2015 Rafael G. Martins <rafael@rafaelmartins.eng.br> - * - * This program can be distributed under the terms of the BSD License. - * See the file LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif /* HAVE_CONFIG_H */ - -#include <stdlib.h> -#include <stdio.h> -#include "utils.h" - - -void* -b_malloc(size_t size) -{ - // simple things simple! - void *rv = malloc(size); - if (rv == NULL) { - fprintf(stderr, "fatal error: Failed to allocate memory!\n"); - exit(1); - } - return rv; -} - - -void* -b_realloc(void *ptr, size_t size) -{ - // simple things even simpler :P - void *rv = realloc(ptr, size); - if (rv == NULL && size != 0) { - fprintf(stderr, "fatal error: Failed to reallocate memory!\n"); - free(ptr); - exit(1); - } - return rv; -} |