summaryrefslogtreecommitdiff
path: root/source/luametatex/source/utilities/auxmemory.c
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-09-16 15:53:42 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-09-16 15:53:42 +0200
commitc161b7d6fe142231346cc1844e6e27c0ab7718c1 (patch)
tree3fd877b8986137703e987e4651a2db8e946a0f72 /source/luametatex/source/utilities/auxmemory.c
parente94fa4dc30ec28a6727aa85e17aaac18b76aeadb (diff)
downloadcontext-c161b7d6fe142231346cc1844e6e27c0ab7718c1.tar.gz
2022-09-16 14:41:00
Diffstat (limited to 'source/luametatex/source/utilities/auxmemory.c')
-rw-r--r--source/luametatex/source/utilities/auxmemory.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/luametatex/source/utilities/auxmemory.c b/source/luametatex/source/utilities/auxmemory.c
new file mode 100644
index 000000000..9ba02f946
--- /dev/null
+++ b/source/luametatex/source/utilities/auxmemory.c
@@ -0,0 +1,25 @@
+/*
+ See license.txt in the root of this project.
+*/
+
+# include "auxmemory.h"
+
+void *aux_allocate_array(int recordsize, int size, int reserved)
+{
+ return lmt_memory_malloc(recordsize * ((size_t) size + reserved + 1));
+}
+
+void *aux_reallocate_array(void *p, int recordsize, int size, int reserved)
+{
+ return lmt_memory_realloc(p, recordsize * ((size_t) size + reserved + 1));
+}
+
+void *aux_allocate_clear_array(int recordsize, int size, int reserved)
+{
+ return lmt_memory_calloc((size_t) size + reserved + 1, recordsize);
+}
+
+void aux_deallocate_array(void *p)
+{
+ lmt_memory_free(p);
+}