Browse Source

set first position of a free block to -1, to catch errors

v5-2
Roberto Ierusalimschy 30 years ago
parent
commit
a5862498a1
  1. 3
      luamem.c

3
luamem.c

@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio ** 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> #include <stdlib.h>
@ -12,6 +12,7 @@ char *rcs_mem = "$Id: $";
void luaI_free (void *block) void luaI_free (void *block)
{ {
*((int *)block) = -1; /* to catch errors */
free(block); free(block);
} }

Loading…
Cancel
Save