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

@@ -69,8 +69,8 @@ int PPCHIRBuilder::Emit(FunctionInfo* symbol_info, uint32_t flags) {
size_t list_size = instr_count_ * sizeof(void*);
instr_offset_list_ = (Instr**)arena_->Alloc(list_size);
label_list_ = (Label**)arena_->Alloc(list_size);
xe_zero_struct(instr_offset_list_, list_size);
xe_zero_struct(label_list_, list_size);
memset(instr_offset_list_, 0, list_size);
memset(label_list_, 0, list_size);
// Always mark entry with label.
label_list_[0] = NewLabel();
@@ -171,7 +171,7 @@ void PPCHIRBuilder::AnnotateLabel(uint64_t address, Label* label) {
snprintf(name_buffer, poly::countof(name_buffer), "loc_%.8X",
(uint32_t)address);
label->name = (char*)arena_->Alloc(sizeof(name_buffer));
xe_copy_struct(label->name, name_buffer, sizeof(name_buffer));
memcpy(label->name, name_buffer, sizeof(name_buffer));
}
FunctionInfo* PPCHIRBuilder::LookupFunction(uint64_t address) {

View File

@@ -95,7 +95,7 @@ namespace tables {
static InstrType** instr_table_prep(InstrType* unprep, size_t unprep_count,
int a, int b) {
int prep_count = (int)pow(2.0, b - a + 1);
InstrType** prep = (InstrType**)xe_calloc(prep_count * sizeof(void*));
InstrType** prep = (InstrType**)calloc(prep_count, sizeof(void*));
for (int n = 0; n < unprep_count; n++) {
int ordinal = select_bits(unprep[n].opcode, a, b);
prep[ordinal] = &unprep[n];
@@ -107,7 +107,7 @@ static InstrType** instr_table_prep_63(InstrType* unprep, size_t unprep_count,
int a, int b) {
// Special handling for A format instructions.
int prep_count = (int)pow(2.0, b - a + 1);
InstrType** prep = (InstrType**)xe_calloc(prep_count * sizeof(void*));
InstrType** prep = (InstrType**)calloc(prep_count, sizeof(void*));
for (int n = 0; n < unprep_count; n++) {
int ordinal = select_bits(unprep[n].opcode, a, b);
if (unprep[n].format == kXEPPCInstrFormatA) {