summaryrefslogtreecommitdiff
path: root/source/luametatex/source/utilities/auxmemory.c
blob: 9ba02f9463864bcab09ebd602351cecb11dc69c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);
}