mirror of
https://github.com/lua/lua
synced 2024-11-25 22:29:39 +03:00
set first position of a free block to -1, to catch errors
This commit is contained in:
parent
2b5bc5d1a8
commit
a5862498a1
3
luamem.c
3
luamem.c
@ -3,7 +3,7 @@
|
||||
** TecCGraf - PUC-Rio
|
||||
*/
|
||||
|
||||
char *rcs_mem = "$Id: $";
|
||||
char *rcs_mem = "$Id: mem.c,v 1.1 1994/11/16 17:38:08 roberto Exp $";
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -12,6 +12,7 @@ char *rcs_mem = "$Id: $";
|
||||
|
||||
void luaI_free (void *block)
|
||||
{
|
||||
*((int *)block) = -1; /* to catch errors */
|
||||
free(block);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user