diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-09-28 21:20:40 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-09-28 21:20:40 +0200 |
commit | e36f3367bbc8973889994abea648db8651ad8580 (patch) | |
tree | 04b64ec822f648121c85e4315abd0e386192c008 /src/alloc.c | |
parent | ccb28724025e886ad7e952f6da28f4a3f3611ea0 (diff) |
update to version 25cjannis
Diffstat (limited to 'src/alloc.c')
-rw-r--r-- | src/alloc.c | 10 |
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) |