Obeying request to zero.
This commit is contained in:
parent
6477d6c21e
commit
11f99ce33b
|
@ -77,7 +77,7 @@ X_STATUS xeNtAllocateVirtualMemory(
|
|||
}
|
||||
|
||||
// Allocate.
|
||||
uint32_t flags = 0;
|
||||
uint32_t flags = (allocation_type & X_MEM_NOZERO);
|
||||
uint32_t addr = xe_memory_heap_alloc(
|
||||
state->memory(), *base_addr_ptr, adjusted_size, flags);
|
||||
if (!addr) {
|
||||
|
|
|
@ -527,7 +527,8 @@ uint32_t xe_memory_heap_t::Alloc(
|
|||
PAGE_READWRITE);
|
||||
}
|
||||
|
||||
if (FLAGS_scribble_heap) {
|
||||
if ((flags & X_MEM_NOZERO) &&
|
||||
FLAGS_scribble_heap) {
|
||||
// Trash the memory so that we can see bad read-before-write bugs easier.
|
||||
memset(p, 0xCD, alloc_size);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue