diff options
| author | 2008-07-14 14:53:08 +0000 | |
|---|---|---|
| committer | 2008-07-14 14:53:08 +0000 | |
| commit | 484efe776b9a80d9492fa5779e770cc0f233ca36 (patch) | |
| tree | f2f3ddb41fa65173d4f6977d628c52f2e9fde498 | |
| parent | 83f6ced61e3300fb03a4a018cf87a6a461acdea6 (diff) | |
Added an exit function to the SH2 drc so that it doesn't leak
memory like crazy.
| -rw-r--r-- | src/emu/cpu/sh2/sh2drc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c index eec2da3ef4e..0378c5e9eef 100644 --- a/src/emu/cpu/sh2/sh2drc.c +++ b/src/emu/cpu/sh2/sh2drc.c @@ -638,6 +638,19 @@ static void sh2_init(int index, int clock, const void *config, int (*irqcallback } /*------------------------------------------------- + sh2_exit - cleanup from execution +-------------------------------------------------*/ + +static void sh2_exit(void) +{ + /* clean up the DRC */ + drcfe_exit(sh2->drcfe); + drcuml_free(sh2->drcuml); + drccache_free(sh2->cache); +} + + +/*------------------------------------------------- sh2_reset - reset the processor -------------------------------------------------*/ @@ -3266,6 +3279,7 @@ void sh2_get_info(UINT32 state, cpuinfo *info) case CPUINFO_PTR_SET_CONTEXT: info->setcontext = sh2_set_context; break; case CPUINFO_PTR_INIT: info->init = sh2_init; break; case CPUINFO_PTR_RESET: info->reset = sh2_reset; break; + case CPUINFO_PTR_EXIT: info->exit = sh2_exit; break; case CPUINFO_PTR_EXECUTE: info->execute = sh2_execute; break; case CPUINFO_PTR_BURN: info->burn = NULL; break; case CPUINFO_PTR_DISASSEMBLE: info->disassemble = sh2_dasm; break; |
