better use of "ASSERT".

This commit is contained in:
Roberto Ierusalimschy
1998-03-09 18:49:52 -03:00
parent be6d215f67
commit 0969a971cd
9 changed files with 34 additions and 19 deletions

6
lmem.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lmem.c,v 1.3 1997/12/01 20:30:44 roberto Exp roberto $
** $Id: lmem.c,v 1.4 1997/12/17 20:48:58 roberto Exp roberto $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
@@ -57,7 +57,6 @@ void *luaM_realloc (void *block, unsigned long size)
#else
/* DEBUG */
#include <assert.h>
#include <string.h>
@@ -71,7 +70,8 @@ static void *checkblock (void *block)
{
unsigned long *b = (unsigned long *)block - 1;
unsigned long size = *b;
assert(*(((char *)b)+size+sizeof(unsigned long)) == MARK);
LUA_ASSERT(*(((char *)b)+size+sizeof(unsigned long)) == MARK,
"corrupted block");
numblocks--;
totalmem -= size;
return b;