Scribble memory when allocated

This commit is contained in:
Dr. Chat 2015-05-16 18:41:18 -05:00
parent da630cc159
commit 6adde32558
1 changed files with 8 additions and 0 deletions

View File

@ -596,6 +596,10 @@ bool BaseHeap::AllocFixed(uint32_t base_address, uint32_t size,
XELOGE("BaseHeap::Alloc failed to alloc range from host");
return false;
}
if (FLAGS_scribble_heap && protect & kMemoryProtectWrite) {
memset(result, 0xCD, page_count * page_size_);
}
}
// Set page state.
@ -725,6 +729,10 @@ bool BaseHeap::AllocRange(uint32_t low_address, uint32_t high_address,
XELOGE("BaseHeap::Alloc failed to alloc range from host");
return false;
}
if (FLAGS_scribble_heap && protect & kMemoryProtectWrite) {
memset(result, 0xCD, page_count * page_size_);
}
}
// Set page state.