diff --git a/servers/vm/alloc.c b/servers/vm/alloc.c index 9782d9ec6..b4b82745e 100644 --- a/servers/vm/alloc.c +++ b/servers/vm/alloc.c @@ -540,6 +540,12 @@ PRIVATE void free_pages(phys_bytes pageno, int npages) assert(!addr_search(&addravl, pageno, AVL_EQUAL)); +#if JUNKFREE + if(sys_memset(0xa5a5a5a5, VM_PAGE_SIZE * pageno, + VM_PAGE_SIZE * npages) != OK) + panic("free_pages: sys_memset failed"); +#endif + /* try to merge with higher neighbour */ if((pr=addr_search(&addravl, pageno+npages, AVL_EQUAL))) { USE(pr, pr->addr -= npages; diff --git a/servers/vm/vm.h b/servers/vm/vm.h index 0a20d6ee4..f3d9b5722 100644 --- a/servers/vm/vm.h +++ b/servers/vm/vm.h @@ -20,6 +20,7 @@ /* Compile in asserts and custom sanity checks at all? */ #define SANITYCHECKS 0 #define VMSTATS 0 +#define JUNKFREE 0 /* Fill freed pages with junk */ /* How noisy are we supposed to be? */ #define VERBOSE 0