imxtools: add function to free instruction

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30919 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Amaury Pouly 2011-11-06 19:41:29 +00:00
parent ad9e280281
commit cd832bd0f5
2 changed files with 8 additions and 4 deletions

View file

@ -1039,13 +1039,16 @@ struct sb_file_t *sb_read_file(const char *filename, bool raw_mode, void *u,
#undef print_hex
}
void sb_free_instruction(struct sb_inst_t inst)
{
free(inst.padding);
free(inst.data);
}
void sb_free_section(struct sb_section_t sec)
{
for(int j = 0; j < sec.nr_insts; j++)
{
free(sec.insts[j].padding);
free(sec.insts[j].data);
}
sb_free_instruction(sec.insts[j]);
free(sec.insts);
}

View file

@ -231,6 +231,7 @@ struct sb_file_t *sb_read_file(const char *filename, bool raw_mode, void *u,
void sb_fill_section_name(char name[5], uint32_t identifier);
void sb_dump(struct sb_file_t *file, void *u, sb_color_printf printf);
void sb_free_instruction(struct sb_inst_t inst);
void sb_free_section(struct sb_section_t file);
void sb_free(struct sb_file_t *file);