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:
parent
ad9e280281
commit
cd832bd0f5
2 changed files with 8 additions and 4 deletions
|
@ -1039,13 +1039,16 @@ struct sb_file_t *sb_read_file(const char *filename, bool raw_mode, void *u,
|
||||||
#undef print_hex
|
#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)
|
void sb_free_section(struct sb_section_t sec)
|
||||||
{
|
{
|
||||||
for(int j = 0; j < sec.nr_insts; j++)
|
for(int j = 0; j < sec.nr_insts; j++)
|
||||||
{
|
sb_free_instruction(sec.insts[j]);
|
||||||
free(sec.insts[j].padding);
|
|
||||||
free(sec.insts[j].data);
|
|
||||||
}
|
|
||||||
free(sec.insts);
|
free(sec.insts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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_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_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_section(struct sb_section_t file);
|
||||||
void sb_free(struct sb_file_t *file);
|
void sb_free(struct sb_file_t *file);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue