Revert TLSF

This commit is contained in:
Willy-JL
2024-06-17 02:31:59 +02:00
parent 6399f717c5
commit 7ffcf97acb
21 changed files with 630 additions and 1947 deletions

View File

@@ -466,7 +466,7 @@ static bool elf_load_section_data(ELFFile* elf, ELFSection* section, Elf32_Shdr*
return true;
}
section->data = aligned_alloc(section_header->sh_addralign, section_header->sh_size);
section->data = aligned_malloc(section_header->sh_size, section_header->sh_addralign);
section->size = section_header->sh_size;
if(section_header->sh_type == SHT_NOBITS) {
@@ -718,7 +718,7 @@ static bool elf_relocate_fast(ELFFile* elf, ELFSection* s) {
}
}
free(s->fast_rel->data);
aligned_free(s->fast_rel->data);
free(s->fast_rel);
s->fast_rel = NULL;
@@ -785,10 +785,10 @@ void elf_file_free(ELFFile* elf) {
ELFSectionDict_next(it)) {
const ELFSectionDict_itref_t* itref = ELFSectionDict_cref(it);
if(itref->value.data) {
free(itref->value.data);
aligned_free(itref->value.data);
}
if(itref->value.fast_rel) {
free(itref->value.fast_rel->data);
aligned_free(itref->value.fast_rel->data);
free(itref->value.fast_rel);
}
free((void*)itref->key);