summaryrefslogtreecommitdiff
path: root/src/arena.c
diff options
context:
space:
mode:
author@syxhe <https://t.me/syxhe>2025-03-30 23:13:35 -0500
committer@syxhe <https://t.me/syxhe>2025-03-30 23:13:35 -0500
commit833cb417608eb138d3a9b99dc995c5c1aeffd1cd (patch)
tree9698c034adb7e5124e91ac79b8eb4d68b047a0f9 /src/arena.c
parent97713275dc87ea1d0afa4fd6bc49f695ad40efc0 (diff)
Create encryption functions that actually work
Diffstat (limited to 'src/arena.c')
-rw-r--r--src/arena.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arena.c b/src/arena.c
index 62dbbf8..de3523b 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -7,7 +7,7 @@
7#include <errno.h> 7#include <errno.h>
8#include <error.h> 8#include <error.h>
9 9
10#define VALLOC(nmemb, size) ((___VXGG___USE_XALLOC_FOR_ARENAS___ > 0) ? xcalloc((nmemb), (size)) : malloc((nmemb) * (size))) 10#define VALLOC(nmemb, size) ((___VXGG___USE_XALLOC_FOR_ARENAS___ > 0) ? xmalloc((nmemb) * (size)) : malloc((nmemb) * (size)))
11 11
12typedef struct an { 12typedef struct an {
13 void *membase; 13 void *membase;
@@ -150,7 +150,7 @@ simplearena * simplearena_init(size_t bytes) {
150 return arena_init(bytes); 150 return arena_init(bytes);
151} 151}
152 152
153void* simplearena_alloc(simplearena * const a, size_t bytes) { 153void * simplearena_alloc(simplearena * const a, size_t bytes) {
154 // The criteria to allocate new memory in arena_alloc is 'bytes > ((a->current)->allocated - (a->current)->used)', so if this 154 // The criteria to allocate new memory in arena_alloc is 'bytes > ((a->current)->allocated - (a->current)->used)', so if this
155 // is true, just return NULL & set errno 155 // is true, just return NULL & set errno
156 156