diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-01-14 19:16:32 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-01-14 19:16:32 +0000 |
| commit | 2a878d51fdfe5832a3b979dbc8e5b2144ad0d1f3 (patch) | |
| tree | f376771a56e794b92adc8efcd80127e5b81e8d49 /src/value.hh | |
| parent | 442304bc1c3d74681beaef735631a62eecd5745f (diff) | |
Even more memory tracking
Diffstat (limited to 'src/value.hh')
| -rw-r--r-- | src/value.hh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/value.hh b/src/value.hh index e663513a..541da3d8 100644 --- a/src/value.hh +++ b/src/value.hh @@ -60,6 +60,10 @@ private: const std::type_info& type() const override { return typeid(T); } T m_content; + + using Alloc = Allocator<Model<T>, MemoryDomain::Values>; + static void* operator new (std::size_t sz) { return Alloc{}.allocate(1); } + static void operator delete (void* ptr) { Alloc{}.deallocate((Model<T>*)ptr, 1); } }; std::unique_ptr<Concept> m_value; @@ -78,7 +82,7 @@ struct ValueId : public StronglyTypedNumber<ValueId, int> inline size_t hash_value(ValueId val) { return hash_value((int)val); } -using ValueMap = UnorderedMap<ValueId, Value>; +using ValueMap = UnorderedMap<ValueId, Value, MemoryDomain::Values>; } |
