summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-09-28 21:20:40 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-09-28 21:20:40 +0200
commite36f3367bbc8973889994abea648db8651ad8580 (patch)
tree04b64ec822f648121c85e4315abd0e386192c008 /src/alloc.c
parentccb28724025e886ad7e952f6da28f4a3f3611ea0 (diff)
update to version 25cjannis
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 7e4ccb4..ea19e8e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -8,13 +8,21 @@
#define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
#define SPACE 4096 /* must be multiple of ALIGNMENT */
+#define space ((char *)realspace)
+
+/**
+ @file alloc.c
+ @authors djb, feh, jmh
+ @ref qmail
+ @brief Generic allocation of heap memory
+*/
typedef union {
char irrelevant[ALIGNMENT];
double d;
} aligned;
+
static aligned realspace[SPACE / ALIGNMENT];
-#define space ((char *)realspace)
static unsigned int avail = SPACE; /* multiple of ALIGNMENT; 0<=avail<=SPACE */
void *alloc(unsigned int n)