vm: junkfree feature that fills freed pages with a recognizable pattern.
This commit is contained in:
parent
a09a8d4f3e
commit
31adc0a3c4
@ -540,6 +540,12 @@ PRIVATE void free_pages(phys_bytes pageno, int npages)
|
|||||||
|
|
||||||
assert(!addr_search(&addravl, pageno, AVL_EQUAL));
|
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 */
|
/* try to merge with higher neighbour */
|
||||||
if((pr=addr_search(&addravl, pageno+npages, AVL_EQUAL))) {
|
if((pr=addr_search(&addravl, pageno+npages, AVL_EQUAL))) {
|
||||||
USE(pr, pr->addr -= npages;
|
USE(pr, pr->addr -= npages;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
/* Compile in asserts and custom sanity checks at all? */
|
/* Compile in asserts and custom sanity checks at all? */
|
||||||
#define SANITYCHECKS 0
|
#define SANITYCHECKS 0
|
||||||
#define VMSTATS 0
|
#define VMSTATS 0
|
||||||
|
#define JUNKFREE 0 /* Fill freed pages with junk */
|
||||||
|
|
||||||
/* How noisy are we supposed to be? */
|
/* How noisy are we supposed to be? */
|
||||||
#define VERBOSE 0
|
#define VERBOSE 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user