aboutsummaryrefslogtreecommitdiff
path: root/lmem.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-02-26 12:48:55 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-02-26 12:48:55 -0300
commit72d675aba78d59e22ebfadbe447f4f51ddab5a5c (patch)
tree2f43006cba58bcfc97f01ecdd6f00e35e92aa673 /lmem.h
parentba57f7d946bc0b600996f7a982b2fb644df76a98 (diff)
downloadlua-72d675aba78d59e22ebfadbe447f4f51ddab5a5c.tar.gz
lua-72d675aba78d59e22ebfadbe447f4f51ddab5a5c.tar.bz2
lua-72d675aba78d59e22ebfadbe447f4f51ddab5a5c.zip
macros "growvector" and "reallocvector" more compact
Diffstat (limited to 'lmem.h')
-rw-r--r--lmem.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lmem.h b/lmem.h
index c8e015d6..679c97b4 100644
--- a/lmem.h
+++ b/lmem.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmem.h,v 1.6 1998/12/15 14:59:43 roberto Exp roberto $ 2** $Id: lmem.h,v 1.7 1999/02/25 15:16:26 roberto Exp roberto $
3** Interface to Memory Manager 3** Interface to Memory Manager
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -16,6 +16,7 @@
16#define refEM "reference table overflow" 16#define refEM "reference table overflow"
17#define tableEM "table overflow" 17#define tableEM "table overflow"
18#define memEM "not enough memory" 18#define memEM "not enough memory"
19#define arrEM "internal array bigger than `int' limit"
19 20
20void *luaM_realloc (void *oldblock, unsigned long size); 21void *luaM_realloc (void *oldblock, unsigned long size);
21void *luaM_growaux (void *block, unsigned long nelems, int inc, int size, 22void *luaM_growaux (void *block, unsigned long nelems, int inc, int size,
@@ -25,9 +26,9 @@ void *luaM_growaux (void *block, unsigned long nelems, int inc, int size,
25#define luaM_malloc(t) luaM_realloc(NULL, (t)) 26#define luaM_malloc(t) luaM_realloc(NULL, (t))
26#define luaM_new(t) ((t *)luaM_malloc(sizeof(t))) 27#define luaM_new(t) ((t *)luaM_malloc(sizeof(t)))
27#define luaM_newvector(n,t) ((t *)luaM_malloc((n)*sizeof(t))) 28#define luaM_newvector(n,t) ((t *)luaM_malloc((n)*sizeof(t)))
28#define luaM_growvector(old,nelems,inc,t,e,l) \ 29#define luaM_growvector(v,nelems,inc,t,e,l) \
29 ((t *)luaM_growaux(old,nelems,inc,sizeof(t),e,l)) 30 ((v)=(t *)luaM_growaux(v,nelems,inc,sizeof(t),e,l))
30#define luaM_reallocvector(v,n,t) ((t *)luaM_realloc(v,(n)*sizeof(t))) 31#define luaM_reallocvector(v,n,t) ((v)=(t *)luaM_realloc(v,(n)*sizeof(t)))
31 32
32 33
33#ifdef DEBUG 34#ifdef DEBUG