diff options
Diffstat (limited to 'lmem.h')
-rw-r--r-- | lmem.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lmem.h,v 1.21 2001/02/20 18:15:33 roberto Exp roberto $ | 2 | ** $Id: lmem.h,v 1.22 2001/02/23 17:17:25 roberto Exp $ |
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 | */ |
@@ -21,20 +21,20 @@ void *luaM_growaux (lua_State *L, void *block, int *size, int size_elem, | |||
21 | #define luaM_free(L, b, s) luaM_realloc(L, (b), (s), 0) | 21 | #define luaM_free(L, b, s) luaM_realloc(L, (b), (s), 0) |
22 | #define luaM_freelem(L, b, t) luaM_realloc(L, (b), sizeof(t), 0) | 22 | #define luaM_freelem(L, b, t) luaM_realloc(L, (b), sizeof(t), 0) |
23 | #define luaM_freearray(L, b, n, t) luaM_realloc(L, (b), \ | 23 | #define luaM_freearray(L, b, n, t) luaM_realloc(L, (b), \ |
24 | ((lu_mem)(n)*(lu_mem)sizeof(t)), 0) | 24 | cast(lu_mem, n)*cast(lu_mem, sizeof(t)), 0) |
25 | 25 | ||
26 | #define luaM_malloc(L, t) luaM_realloc(L, NULL, 0, (t)) | 26 | #define luaM_malloc(L, t) luaM_realloc(L, NULL, 0, (t)) |
27 | #define luaM_new(L, t) ((t *)luaM_malloc(L, sizeof(t))) | 27 | #define luaM_new(L, t) cast(t *, luaM_malloc(L, sizeof(t))) |
28 | #define luaM_newvector(L, n,t) ((t *)luaM_malloc(L, \ | 28 | #define luaM_newvector(L, n,t) cast(t *, luaM_malloc(L, \ |
29 | (lu_mem)(n)*(lu_mem)sizeof(t))) | 29 | cast(lu_mem, n)*cast(lu_mem, sizeof(t)))) |
30 | 30 | ||
31 | #define luaM_growvector(L,v,nelems,size,t,limit,e) \ | 31 | #define luaM_growvector(L,v,nelems,size,t,limit,e) \ |
32 | if (((nelems)+1) > (size)) \ | 32 | if (((nelems)+1) > (size)) \ |
33 | ((v)=(t *)luaM_growaux(L,v,&(size),sizeof(t),limit,e)) | 33 | ((v)=cast(t *, luaM_growaux(L,v,&(size),sizeof(t),limit,e))) |
34 | 34 | ||
35 | #define luaM_reallocvector(L, v,oldn,n,t) \ | 35 | #define luaM_reallocvector(L, v,oldn,n,t) \ |
36 | ((v)=(t *)luaM_realloc(L, v,(lu_mem)(oldn)*(lu_mem)sizeof(t), \ | 36 | ((v)=cast(t *, luaM_realloc(L, v,cast(lu_mem, oldn)*cast(lu_mem, sizeof(t)), \ |
37 | (lu_mem)(n)*(lu_mem)sizeof(t))) | 37 | cast(lu_mem, n)*cast(lu_mem, sizeof(t))))) |
38 | 38 | ||
39 | 39 | ||
40 | #endif | 40 | #endif |