From 6321041058ec7a597a39df4564f28d5012fd7dfb Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 19 Dec 2014 11:45:40 -0200 Subject: new macro 'luaM_reallocvchar' to allocate arrays of chars (avoids uneeded tests and respective warnings) --- lmem.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lmem.h') diff --git a/lmem.h b/lmem.h index d9afa3c6..9caf42fc 100644 --- a/lmem.h +++ b/lmem.h @@ -1,5 +1,5 @@ /* -** $Id: lmem.h,v 1.40 2013/02/20 14:08:21 roberto Exp roberto $ +** $Id: lmem.h,v 1.41 2014/10/08 20:25:51 roberto Exp roberto $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ @@ -32,6 +32,11 @@ ? luaM_toobig(L) : cast_void(0)) , \ luaM_realloc_(L, (b), (on)*(e), (n)*(e))) +/* +** Arrays of chars do not need any test +*/ +#define luaM_reallocvchar(L,b,on,n) luaM_realloc_(L, (b), (on), (n)) + #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) #define luaM_freearray(L, b, n) luaM_realloc_(L, (b), (n)*sizeof(*(b)), 0) -- cgit v1.2.3-55-g6feb