diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-03-09 18:49:52 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-03-09 18:49:52 -0300 |
| commit | 0969a971cd41921bd5ee72c1da880455bcca3bb4 (patch) | |
| tree | 74be9a39706eeb1e7f4e5c2cf49693364c399790 /lmem.c | |
| parent | be6d215f674f3d148d3f80a0553e8b2aa6da51d7 (diff) | |
| download | lua-0969a971cd41921bd5ee72c1da880455bcca3bb4.tar.gz lua-0969a971cd41921bd5ee72c1da880455bcca3bb4.tar.bz2 lua-0969a971cd41921bd5ee72c1da880455bcca3bb4.zip | |
better use of "ASSERT".
Diffstat (limited to 'lmem.c')
| -rw-r--r-- | lmem.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lmem.c,v 1.3 1997/12/01 20:30:44 roberto Exp roberto $ | 2 | ** $Id: lmem.c,v 1.4 1997/12/17 20:48:58 roberto Exp roberto $ |
| 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 | */ |
| @@ -57,7 +57,6 @@ void *luaM_realloc (void *block, unsigned long size) | |||
| 57 | #else | 57 | #else |
| 58 | /* DEBUG */ | 58 | /* DEBUG */ |
| 59 | 59 | ||
| 60 | #include <assert.h> | ||
| 61 | #include <string.h> | 60 | #include <string.h> |
| 62 | 61 | ||
| 63 | 62 | ||
| @@ -71,7 +70,8 @@ static void *checkblock (void *block) | |||
| 71 | { | 70 | { |
| 72 | unsigned long *b = (unsigned long *)block - 1; | 71 | unsigned long *b = (unsigned long *)block - 1; |
| 73 | unsigned long size = *b; | 72 | unsigned long size = *b; |
| 74 | assert(*(((char *)b)+size+sizeof(unsigned long)) == MARK); | 73 | LUA_ASSERT(*(((char *)b)+size+sizeof(unsigned long)) == MARK, |
| 74 | "corrupted block"); | ||
| 75 | numblocks--; | 75 | numblocks--; |
| 76 | totalmem -= size; | 76 | totalmem -= size; |
| 77 | return b; | 77 | return b; |
