diff options
| -rw-r--r-- | Makefile | 5 | ||||
| -rw-r--r-- | compat/mmap-blob.c | 4 |
2 files changed, 9 insertions, 0 deletions
@@ -9,6 +9,11 @@ LDFLAGS=-g AR=ar # +# For debugging, uncomment the next one +# +CFLAGS += -DDEBUG + +# # If building with shared libraries, you might # want to add this # diff --git a/compat/mmap-blob.c b/compat/mmap-blob.c index 3626cc73..1cab4dea 100644 --- a/compat/mmap-blob.c +++ b/compat/mmap-blob.c @@ -29,5 +29,9 @@ void blob_free(void *addr, unsigned long size) { if (!size || (size & ~CHUNK) || ((unsigned long) addr & 512)) die("internal error: bad blob free (%lu bytes at %p)", size, addr); +#ifndef DEBUG munmap(addr, size); +#else + mprotect(addr, size, PROT_NONE); +#endif } |
