From 3671892c34d1ad41795794352d5cd7d8ff6cff64 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 26 Sep 2016 22:24:49 +0200 Subject: [PATCH] Move the array library into the data module. --- mach/proto/mcg/build.lua | 1 + {mach/proto/mcg => modules/src/data}/array.c | 5 ++--- {mach/proto/mcg => modules/src/data}/array.h | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename {mach/proto/mcg => modules/src/data}/array.c (93%) rename {mach/proto/mcg => modules/src/data}/array.h (100%) diff --git a/mach/proto/mcg/build.lua b/mach/proto/mcg/build.lua index b9440a790..dc3504294 100644 --- a/mach/proto/mcg/build.lua +++ b/mach/proto/mcg/build.lua @@ -16,6 +16,7 @@ cprogram { "h+emheaders", "modules+headers", "modules/src/alloc+lib", + "modules/src/data+lib", "modules/src/em_code+lib_k", "modules/src/em_data+lib", "modules/src/idf+lib", diff --git a/mach/proto/mcg/array.c b/modules/src/data/array.c similarity index 93% rename from mach/proto/mcg/array.c rename to modules/src/data/array.c index a375bafb5..9f61d2805 100644 --- a/mach/proto/mcg/array.c +++ b/modules/src/data/array.c @@ -1,4 +1,5 @@ -#include "mcg.h" +#include +#include #include "array.h" void array_append(void*** array, int* count, int* max, void* value) @@ -7,8 +8,6 @@ void array_append(void*** array, int* count, int* max, void* value) { int newmax = (*max == 0) ? 8 : (*max * 2); void** newarray = realloc(*array, newmax * sizeof(void*)); - if (!newarray) - fatal("memory allocation failure"); *max = newmax; *array = newarray; diff --git a/mach/proto/mcg/array.h b/modules/src/data/array.h similarity index 100% rename from mach/proto/mcg/array.h rename to modules/src/data/array.h