aboutsummaryrefslogtreecommitdiff
path: root/luamem.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-07-30 15:29:08 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-07-30 15:29:08 -0300
commit1d7857bc635c0bfe7c5b1f325d31feb7660e9a5a (patch)
tree699f68a1d92ac448779a3196f30bc8d491b7f379 /luamem.h
parent72a1d81b510797759a8a5b9e701eb4b791aa8a84 (diff)
downloadlua-1d7857bc635c0bfe7c5b1f325d31feb7660e9a5a.tar.gz
lua-1d7857bc635c0bfe7c5b1f325d31feb7660e9a5a.tar.bz2
lua-1d7857bc635c0bfe7c5b1f325d31feb7660e9a5a.zip
free(b) is equivalent to realloc(b, 0)
Diffstat (limited to 'luamem.h')
-rw-r--r--luamem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/luamem.h b/luamem.h
index 8b88ee9b..f9c573d7 100644
--- a/luamem.h
+++ b/luamem.h
@@ -1,7 +1,7 @@
1/* 1/*
2** mem.c 2** mem.c
3** memory manager for lua 3** memory manager for lua
4** $Id: luamem.h,v 1.9 1997/03/31 14:10:11 roberto Exp roberto $ 4** $Id: luamem.h,v 1.10 1997/07/29 20:38:45 roberto Exp roberto $
5*/ 5*/
6 6
7#ifndef luamem_h 7#ifndef luamem_h
@@ -23,12 +23,12 @@
23#define memEM "not enough memory" 23#define memEM "not enough memory"
24 24
25 25
26void luaI_free (void *block);
27void *luaI_realloc (void *oldblock, unsigned long size); 26void *luaI_realloc (void *oldblock, unsigned long size);
28void *luaI_buffer (unsigned long size); 27void *luaI_buffer (unsigned long size);
29int luaI_growvector (void **block, unsigned long nelems, int size, 28int luaI_growvector (void **block, unsigned long nelems, int size,
30 char *errormsg, unsigned long limit); 29 char *errormsg, unsigned long limit);
31 30
31#define luaI_free(b) luaI_realloc((b), 0)
32#define luaI_malloc(s) luaI_realloc(NULL, (s)) 32#define luaI_malloc(s) luaI_realloc(NULL, (s))
33#define new(s) ((s *)luaI_malloc(sizeof(s))) 33#define new(s) ((s *)luaI_malloc(sizeof(s)))
34#define newvector(n,s) ((s *)luaI_malloc((n)*sizeof(s))) 34#define newvector(n,s) ((s *)luaI_malloc((n)*sizeof(s)))