summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
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)