Clear all allocated memory.

This commit is contained in:
Ben Vanik 2013-10-27 16:01:35 -07:00
parent 74ff6bd4fa
commit 7d6dda356c
1 changed files with 3 additions and 0 deletions

View File

@ -531,6 +531,9 @@ uint32_t xe_memory_heap_t::Alloc(
FLAGS_scribble_heap) {
// Trash the memory so that we can see bad read-before-write bugs easier.
memset(p, 0xCD, alloc_size);
} else {
// Implicit clear.
memset(p, 0, alloc_size);
}
return (uint32_t)((uintptr_t)p - (uintptr_t)memory->mapping_base);