dlmalloc does not fail when it runs out of memory...

This commit is contained in:
Ben Vanik 2014-08-05 12:05:27 -07:00
parent 07afc58264
commit 1d7b08b85b
2 changed files with 2 additions and 0 deletions

View File

@ -508,6 +508,7 @@ uint64_t XenonMemoryHeap::Alloc(
space_,
alignment,
alloc_size + heap_guard_size * 2);
assert_true(reinterpret_cast<uint64_t>(p) <= 0xFFFFFFFFFull);
if (FLAGS_heap_guard_pages) {
size_t real_size = mspace_usable_size(p);
DWORD old_protect;

View File

@ -24,6 +24,7 @@ XenonThreadState::XenonThreadState(XenonRuntime* runtime, uint32_t thread_id,
stack_size_(stack_size),
thread_state_address_(thread_state_address) {
stack_address_ = memory_->HeapAlloc(0, stack_size, MEMORY_FLAG_ZERO);
assert_not_zero(stack_address_);
// Allocate with 64b alignment.
context_ = (PPCContext*)xe_malloc_aligned(sizeof(PPCContext));