From 950e6c9148eca244a89d18a21d4ae4e5c3d1c646 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Wed, 23 Dec 2015 19:53:04 +0100 Subject: 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 --- src/utils/mem.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 src/utils/mem.c (limited to 'src/utils/mem.c') 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 - * - * This program can be distributed under the terms of the BSD License. - * See the file LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - -#include -#include -#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; -} -- cgit v1.2.3-18-g5258