Removing xenia/malloc.*

Using standard memory functions now.
This commit is contained in:
Ben Vanik
2014-08-20 22:22:47 -07:00
parent 609d7c755f
commit cecf83b7b7
36 changed files with 266 additions and 481 deletions

View File

@@ -25,13 +25,13 @@ IVMFunction::IVMFunction(FunctionInfo* symbol_info)
: Function(symbol_info),
register_count_(0),
intcode_count_(0),
intcodes_(0),
intcodes_(nullptr),
source_map_count_(0),
source_map_(0) {}
source_map_(nullptr) {}
IVMFunction::~IVMFunction() {
xe_free(intcodes_);
xe_free(source_map_);
free(intcodes_);
free(source_map_);
}
void IVMFunction::Setup(TranslationContext& ctx) {

View File

@@ -65,12 +65,12 @@ void IVMStack::Free(size_t register_count) {
IVMStack::Chunk::Chunk(size_t chunk_size)
: prev(NULL), next(NULL), capacity(chunk_size), buffer(0), offset(0) {
buffer = (uint8_t*)xe_malloc(capacity);
buffer = reinterpret_cast<uint8_t*>(malloc(capacity));
}
IVMStack::Chunk::~Chunk() {
if (buffer) {
xe_free(buffer);
free(buffer);
}
}

View File

@@ -93,8 +93,7 @@ int X64Assembler::Assemble(FunctionInfo* symbol_info, HIRBuilder* builder,
void X64Assembler::DumpMachineCode(DebugInfo* debug_info, void* machine_code,
size_t code_size, StringBuffer* str) {
BE::DISASM disasm;
xe_zero_struct(&disasm, sizeof(disasm));
BE::DISASM disasm = {0};
disasm.Archi = 64;
disasm.Options = BE::Tabulation + BE::MasmSyntax + BE::PrefixedNumeral;
disasm.EIP = (BE::UIntPtr)machine_code;

View File

@@ -76,7 +76,7 @@ void* X64CodeCache::PlaceCode(void* machine_code, size_t code_size,
lock_.unlock();
// Copy code.
xe_copy_struct(final_address, machine_code, code_size);
memcpy(final_address, machine_code, code_size);
return final_address;
}