Linux tweaks.

This commit is contained in:
Ben Vanik
2015-08-18 14:18:00 -07:00
parent 19299fad4b
commit 8b0d4fb51c
37 changed files with 200 additions and 111 deletions

View File

@@ -9,6 +9,7 @@
#include "xenia/cpu/thread_state.h"
#include <cstdlib>
#include <cstring>
#include "xenia/base/assert.h"
@@ -85,7 +86,7 @@ ThreadState::ThreadState(Processor* processor, uint32_t thread_id,
// Allocate with 64b alignment.
context_ =
reinterpret_cast<PPCContext*>(_aligned_malloc(sizeof(PPCContext), 64));
reinterpret_cast<PPCContext*>(aligned_alloc(64, sizeof(PPCContext)));
assert_true(((uint64_t)context_ & 0x3F) == 0);
std::memset(context_, 0, sizeof(PPCContext));
@@ -110,7 +111,7 @@ ThreadState::~ThreadState() {
thread_state_ = nullptr;
}
_aligned_free(context_);
free(context_);
if (stack_allocated_) {
memory()->LookupHeap(stack_address_)->Decommit(stack_address_, stack_size_);
}