6 char *rcs_mem
= "$Id: mem.c,v 1.13 1996/05/24 14:31:10 roberto Exp $";
14 void luaI_free (void *block
)
18 *((int *)block
) = -1; /* to catch errors */
24 void *luaI_realloc (void *oldblock
, unsigned long size
)
27 size_t s
= (size_t)size
;
29 lua_error("Allocation Error: Block too big");
30 block
= oldblock
? realloc(oldblock
, s
) : malloc(s
);
37 int luaI_growvector (void **block
, unsigned long nelems
, int size
,
38 char *errormsg
, unsigned long limit
)
42 nelems
= (nelems
== 0) ? 20 : nelems
*2;
45 *block
= luaI_realloc(*block
, nelems
*size
);
50 void* luaI_buffer (unsigned long size
)
52 static unsigned long buffsize
= 0;
53 static char* buffer
= NULL
;
55 buffer
= luaI_realloc(buffer
, buffsize
=size
);