Skip to content

avoid mem leakage inside of sc_variable_vector resize#13

Open
hliu71 wants to merge 1 commit into
mainfrom
Bugfix/sc_variable_vector
Open

avoid mem leakage inside of sc_variable_vector resize#13
hliu71 wants to merge 1 commit into
mainfrom
Bugfix/sc_variable_vector

Conversation

@hliu71

@hliu71 hliu71 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

here unique_ptr is used for values
std::vector<std::unique_ptr<sc_variable>> values;
std::function<sc_variable(char const, size_t)> creator;

I test the implementation in archsim, scenario is passing.

Limitation is
resize(10, 5);
resize(5,8);

values' size will be schrinked, but the value of elements are still 5
(similar to std::vector).
to remove limitation, updates required-:)
initial version to avoid mem leakage

@hliu71 hliu71 requested a review from eyck June 26, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants