You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a test module that uses HyperScan and checked for memory leaks using an application verifier.
However, when running hs_compile, a memory leak occurs.
The memory where the leak occurs is the MergeKey *mk allocated in the code below.
#ifndef _WIN32
engine_groups[MergeKey(left, parents)].push_back(left);
#else
// On windows, when passing MergeKey object into map 'engine_groups',
// it will not be copied, but will be freed along with
// engine_groups.clear().
// If we construct MergeKey object on the stack, it will be destructed
// on its life cycle ending, then on engine_groups.clear(), which
// will cause is_block_type_valid() assertion error in MergeKey
// destructor.
MergeKey *mk = new MergeKey(left, parents); // Memory Leak!!
engine_groups[*mk].push_back(left);
#endif
}
vector<vector<left_id>> chunks;
for (auto &raw_group : engine_groups | map_values) {
chunk(move(raw_group), &chunks, MERGE_GROUP_SIZE_MAX);
}
engine_groups.clear(); // It is not released here.
I confirmed that memory leaks do not occur if I put the allocations in a separate list and free them when the function ends.
The text was updated successfully, but these errors were encountered:
I created a test module that uses HyperScan and checked for memory leaks using an application verifier.
However, when running hs_compile, a memory leak occurs.
The memory where the leak occurs is the MergeKey *mk allocated in the code below.
I confirmed that memory leaks do not occur if I put the allocations in a separate list and free them when the function ends.
The text was updated successfully, but these errors were encountered: