Skip to content

Commit

Permalink
Bugfix in freeing object cache data
Browse files Browse the repository at this point in the history
  • Loading branch information
KIwabuchi committed Nov 28, 2023
1 parent 8df4db7 commit 6934a6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/metall/kernel/object_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,10 @@ class object_cache {
}

private:
struct free_deleter {
void operator()(void *const p) const noexcept { std::free(p); }
};

inline static unsigned int priv_get_num_cpus() {
return mdtl::get_num_cpus();
}
Expand Down Expand Up @@ -755,7 +759,7 @@ class object_cache {
#ifdef METALL_ENABLE_MUTEX_IN_OBJECT_CACHE
std::vector<mutex_type> m_mutex;
#endif
std::unique_ptr<cache_storage_type[]> m_cache{nullptr};
std::unique_ptr<cache_storage_type[], free_deleter> m_cache{nullptr};
};

// const_bin_iterator
Expand Down

0 comments on commit 6934a6d

Please sign in to comment.