aboutsummaryrefslogtreecommitdiff
path: root/luamem.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-16 15:39:16 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-16 15:39:16 -0200
commit2b5bc5d1a81579a76c13e638de2592e2c39c73f0 (patch)
tree8294278f9fbd2565d3a2cd11642fed41982824bd /luamem.h
parent94686ce58554a80374eeff115ee5b87c184ed173 (diff)
downloadlua-2b5bc5d1a81579a76c13e638de2592e2c39c73f0.tar.gz
lua-2b5bc5d1a81579a76c13e638de2592e2c39c73f0.tar.bz2
lua-2b5bc5d1a81579a76c13e638de2592e2c39c73f0.zip
new module for memory allocation
Diffstat (limited to 'luamem.h')
-rw-r--r--luamem.h23
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
14void luaI_free (void *block);
15void *luaI_malloc (unsigned long size);
16void *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