diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-16 16:09:11 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-16 16:09:11 -0200 |
| commit | a5862498a19cc8a25ef22b29c1e7103c5c0466f8 (patch) | |
| tree | ae067b0d7b71a6b84d03f41beb9cdef44cfab361 /luamem.c | |
| parent | 2b5bc5d1a81579a76c13e638de2592e2c39c73f0 (diff) | |
| download | lua-a5862498a19cc8a25ef22b29c1e7103c5c0466f8.tar.gz lua-a5862498a19cc8a25ef22b29c1e7103c5c0466f8.tar.bz2 lua-a5862498a19cc8a25ef22b29c1e7103c5c0466f8.zip | |
set first position of a free block to -1, to catch errors
Diffstat (limited to '')
| -rw-r--r-- | luamem.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_mem = "$Id: $"; | 6 | char *rcs_mem = "$Id: mem.c,v 1.1 1994/11/16 17:38:08 roberto Exp $"; |
| 7 | 7 | ||
| 8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
| 9 | 9 | ||
| @@ -12,6 +12,7 @@ char *rcs_mem = "$Id: $"; | |||
| 12 | 12 | ||
| 13 | void luaI_free (void *block) | 13 | void luaI_free (void *block) |
| 14 | { | 14 | { |
| 15 | *((int *)block) = -1; /* to catch errors */ | ||
| 15 | free(block); | 16 | free(block); |
| 16 | } | 17 | } |
| 17 | 18 | ||
