aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Liodden <eriklio@stud.ntnu.no>2017-11-09 15:02:12 +0100
committerErik Liodden <eriklio@stud.ntnu.no>2017-11-15 15:59:55 +0100
commit9ffde2d19f70a54efd297d0f34eda91e012ca18a (patch)
tree4192baf170b5adff875aac539cff2af4ff57b8fe
parent1c8c71eac2abc91c582652156d1be0401dd3be17 (diff)
downloadalgdat-9ffde2d19f70a54efd297d0f34eda91e012ca18a.tar.gz
change to malloc wrapper
-rw-r--r--src/misc/list.c4
-rw-r--r--src/misc/module.mk3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/misc/list.c b/src/misc/list.c
index 56f4ee2..ff83889 100644
--- a/src/misc/list.c
+++ b/src/misc/list.c
@@ -10,6 +10,7 @@
#include <assert.h>
#include <string.h>
#include "list.h"
+#include "misc.h"
@@ -29,8 +30,7 @@ void stack_init(struct stack *s, size_t elem_size)
s->elem_size = elem_size;
s->log_length = 0;
s->alloc_length = 4;
- s->elems = malloc(s->alloc_length * elem_size);
- assert(s->elems != NULL);
+ s->elems = allocate(s->alloc_length * elem_size);
}
void stack_destroy(struct stack *s)
diff --git a/src/misc/module.mk b/src/misc/module.mk
index e659246..d92b7f1 100644
--- a/src/misc/module.mk
+++ b/src/misc/module.mk
@@ -1,2 +1,3 @@
SRC += misc/list.c \
- misc/io.c
+ misc/io.c \
+ misc/misc.c