Starting to remove some macros.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <xenia/cpu/xenon_memory.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <mutex>
|
||||
|
||||
#include <gflags/gflags.h>
|
||||
@@ -482,7 +483,7 @@ XenonMemoryHeap::~XenonMemoryHeap() {
|
||||
}
|
||||
|
||||
if (ptr_) {
|
||||
XEIGNORE(VirtualFree(ptr_, 0, MEM_RELEASE));
|
||||
VirtualFree(ptr_, 0, MEM_RELEASE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,13 +509,11 @@ uint64_t XenonMemoryHeap::Alloc(
|
||||
size_t alloc_size = size;
|
||||
size_t heap_guard_size = FLAGS_heap_guard_pages * 4096;
|
||||
if (heap_guard_size) {
|
||||
alignment = (uint32_t)MAX(alignment, heap_guard_size);
|
||||
alignment = std::max(alignment, static_cast<uint32_t>(heap_guard_size));
|
||||
alloc_size = (uint32_t)XEROUNDUP(size, heap_guard_size);
|
||||
}
|
||||
uint8_t* p = (uint8_t*)mspace_memalign(
|
||||
space_,
|
||||
alignment,
|
||||
alloc_size + heap_guard_size * 2);
|
||||
uint8_t* p = (uint8_t*)mspace_memalign(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);
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <xenia/cpu/xex_module.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <xenia/cpu/cpu-private.h>
|
||||
#include <xenia/cpu/xenon_runtime.h>
|
||||
#include <xenia/export_resolver.h>
|
||||
@@ -54,8 +56,10 @@ int XexModule::Load(const std::string& name, const std::string& path, xe_xex2_re
|
||||
const size_t end_address =
|
||||
start_address + (section->info.page_count * xe_xex2_section_length);
|
||||
if (section->info.type == XEX_SECTION_CODE) {
|
||||
low_address_ = (uint32_t)MIN(low_address_, start_address);
|
||||
high_address_ = (uint32_t)MAX(high_address_, end_address);
|
||||
low_address_ =
|
||||
static_cast<uint32_t>(std::min(low_address_, start_address));
|
||||
high_address_ =
|
||||
static_cast<uint32_t>(std::max(high_address_, end_address));
|
||||
}
|
||||
i += section->info.page_count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user