Browse Source
Merge pull request #2091 from aap-sc/aap-sc/leakage_fix
Get rid of leaking pointers in examples for custom extension
pull/2094/head
Andrew Waterman
10 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
4 additions and
4 deletions
-
ci-tests/custom-csr.cc
-
ci-tests/test-customext.cc
-
customext/cflush.cc
-
customext/dummy_rocc.cc
|
|
|
@ -37,7 +37,7 @@ struct xdummycsr_t : public extension_t { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
REGISTER_EXTENSION(dummycsr, []() { return new xdummycsr_t; }) |
|
|
|
REGISTER_EXTENSION(dummycsr, []() { static xdummycsr_t ext; return &ext; }) |
|
|
|
|
|
|
|
// Copied from spike main.
|
|
|
|
// TODO: This should really be provided in libriscv
|
|
|
|
|
|
|
|
@ -46,7 +46,7 @@ struct xslliuw_dummy_t : public extension_t { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
REGISTER_EXTENSION(dummyslliuw, []() { return new xslliuw_dummy_t; }) |
|
|
|
REGISTER_EXTENSION(dummyslliuw, []() { static xslliuw_dummy_t ext; return &ext; }) |
|
|
|
|
|
|
|
// Copied from spike main.
|
|
|
|
// TODO: This should really be provided in libriscv
|
|
|
|
|
|
|
|
@ -40,4 +40,4 @@ class cflush_t : public extension_t |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
REGISTER_EXTENSION(cflush, []() { return new cflush_t; }) |
|
|
|
REGISTER_EXTENSION(cflush, []() { static cflush_t ext; return &ext; }) |
|
|
|
|
|
|
|
@ -44,4 +44,4 @@ class dummy_rocc_t : public rocc_t |
|
|
|
reg_t acc[num_acc]; |
|
|
|
}; |
|
|
|
|
|
|
|
REGISTER_EXTENSION(dummy_rocc, []() { return new dummy_rocc_t; }) |
|
|
|
REGISTER_EXTENSION(dummy_rocc, []() { static dummy_rocc_t ext; return &ext; }) |
|
|
|
|