diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-16 15:39:16 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-16 15:39:16 -0200 |
commit | 2b5bc5d1a81579a76c13e638de2592e2c39c73f0 (patch) | |
tree | 8294278f9fbd2565d3a2cd11642fed41982824bd /luamem.h | |
parent | 94686ce58554a80374eeff115ee5b87c184ed173 (diff) | |
download | lua-2b5bc5d1a81579a76c13e638de2592e2c39c73f0.tar.gz lua-2b5bc5d1a81579a76c13e638de2592e2c39c73f0.tar.bz2 lua-2b5bc5d1a81579a76c13e638de2592e2c39c73f0.zip |
new module for memory allocation
Diffstat (limited to 'luamem.h')
-rw-r--r-- | luamem.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/luamem.h b/luamem.h new file mode 100644 index 00000000..c75dd211 --- /dev/null +++ b/luamem.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | ** mem.c | ||
3 | ** memory manager for lua | ||
4 | ** $Id: $ | ||
5 | */ | ||
6 | |||
7 | #ifndef mem_h | ||
8 | #define mem_h | ||
9 | |||
10 | #ifndef NULL | ||
11 | #define NULL 0 | ||
12 | #endif | ||
13 | |||
14 | void luaI_free (void *block); | ||
15 | void *luaI_malloc (unsigned long size); | ||
16 | void *luaI_realloc (void *oldblock, unsigned long size); | ||
17 | |||
18 | #define new(s) ((s *)luaI_malloc(sizeof(s))) | ||
19 | #define newvector(n,s) ((s *)luaI_malloc((n)*sizeof(s))) | ||
20 | #define growvector(old,n,s) ((s *)luaI_realloc(old,(n)*sizeof(s))) | ||
21 | |||
22 | #endif | ||
23 | |||