vm: junkfree feature that fills freed pages with a recognizable pattern.

This commit is contained in:
Ben Gras 2010-06-08 00:59:48 +00:00
parent a09a8d4f3e
commit 31adc0a3c4
2 changed files with 7 additions and 0 deletions

View file

@ -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;

View file

@ -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