diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-12-21 21:55:59 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-12-21 21:55:59 +0200 |
| commit | 706b99e3bda688c9adc9a70bb95b96bce1146f57 (patch) | |
| tree | b5acfcf1d9e5cf77676683ad429bc88fe13c89f9 /src | |
| parent | 452cab52de2107c1ce8c7eb0883ff80bb80ac76b (diff) | |
| download | gran-706b99e3bda688c9adc9a70bb95b96bce1146f57.tar.gz gran-706b99e3bda688c9adc9a70bb95b96bce1146f57.zip | |
check for leaked memory
Diffstat (limited to 'src')
| -rw-r--r-- | src/cpu/riscv/simt_riscv64.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cpu/riscv/simt_riscv64.c b/src/cpu/riscv/simt_riscv64.c index 68e87a5..d6a002b 100644 --- a/src/cpu/riscv/simt_riscv64.c +++ b/src/cpu/riscv/simt_riscv64.c @@ -226,6 +226,21 @@ static stat simt_riscv64_clock(struct simt_riscv64 *c) return r; } +static void simt_riscv64_destroy(struct simt_riscv64 *c) +{ + foreach(lanes, core, &c->lanes) { + if ((*core)->destroy) + (*core)->destroy(*core); + else + free(*core); + } + + lanes_destroy(&c->lanes); + reqs_destroy(&c->data_rqs); + reqs_destroy(&c->inst_rqs); + free(c); +} + struct component *create_simt_riscv64( struct simt_riscv64_conf conf, struct component *imem, @@ -236,6 +251,7 @@ struct component *create_simt_riscv64( return NULL; new->component.clock = (clock_callback)simt_riscv64_clock; + new->component.destroy = (destroy_callback)simt_riscv64_destroy; new->conf = conf; new->imem = imem; |
