diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-09-16 16:25:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-09-16 16:25:59 -0300 |
commit | dadba4d6ed9f7432185816abcbb788125aa991ff (patch) | |
tree | 343ec90be7f956520f7e8ac9bb6d8eb73f01138d /luamem.h | |
parent | d600a6b5b358c28d482b01f10bfa3292b17f5d12 (diff) | |
download | lua-dadba4d6ed9f7432185816abcbb788125aa991ff.tar.gz lua-dadba4d6ed9f7432185816abcbb788125aa991ff.tar.bz2 lua-dadba4d6ed9f7432185816abcbb788125aa991ff.zip |
Interface to Memory Manager
Diffstat (limited to 'luamem.h')
-rw-r--r-- | luamem.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/luamem.h b/luamem.h deleted file mode 100644 index f9c573d7..00000000 --- a/luamem.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | ** mem.c | ||
3 | ** memory manager for lua | ||
4 | ** $Id: luamem.h,v 1.10 1997/07/29 20:38:45 roberto Exp roberto $ | ||
5 | */ | ||
6 | |||
7 | #ifndef luamem_h | ||
8 | #define luamem_h | ||
9 | |||
10 | #ifndef NULL | ||
11 | #define NULL 0 | ||
12 | #endif | ||
13 | |||
14 | |||
15 | /* memory error messages */ | ||
16 | #define codeEM "code size overflow" | ||
17 | #define symbolEM "symbol table overflow" | ||
18 | #define constantEM "constant table overflow" | ||
19 | #define stackEM "stack size overflow" | ||
20 | #define lexEM "lex buffer overflow" | ||
21 | #define refEM "reference table overflow" | ||
22 | #define tableEM "table overflow" | ||
23 | #define memEM "not enough memory" | ||
24 | |||
25 | |||
26 | void *luaI_realloc (void *oldblock, unsigned long size); | ||
27 | void *luaI_buffer (unsigned long size); | ||
28 | int luaI_growvector (void **block, unsigned long nelems, int size, | ||
29 | char *errormsg, unsigned long limit); | ||
30 | |||
31 | #define luaI_free(b) luaI_realloc((b), 0) | ||
32 | #define luaI_malloc(s) luaI_realloc(NULL, (s)) | ||
33 | #define new(s) ((s *)luaI_malloc(sizeof(s))) | ||
34 | #define newvector(n,s) ((s *)luaI_malloc((n)*sizeof(s))) | ||
35 | #define growvector(old,n,s,e,l) \ | ||
36 | (luaI_growvector((void**)old,n,sizeof(s),e,l)) | ||
37 | #define shrinkvector(v,n,t) ((t *)luaI_realloc(v,(n)*sizeof(t))) | ||
38 | |||
39 | #endif | ||
40 | |||