Test more memory tracking

This commit is contained in:
Daniel James committed 2017-04-18 10:14:26 +01:00
1 parent e0054c7dd0
commit cafd236a18
3 files changed
+118 -47

No files matched your search

+10 -3
View File
@@ -391,16 +391,23 @@ template <class T> class allocator1
::operator delete((void*)p);
}
#if BOOST_UNORDERED_CXX11_CONSTRUCTION
template <typename... Args> void construct(T* p, Args&&... args)
{
detail::tracker.track_construct((void*)p, sizeof(T), tag_);
new (p) T(boost::forward<Args>(args)...);
}
#else
void construct(T* p, T const& t)
{
// Don't count constructions here as it isn't always called.
// detail::tracker.track_construct((void*) p, sizeof(T), tag_);
detail::tracker.track_construct((void*)p, sizeof(T), tag_);
new (p) T(t);
}
#endif
void destroy(T* p)
{
// detail::tracker.track_destroy((void*) p, sizeof(T), tag_);
detail::tracker.track_destroy((void*)p, sizeof(T), tag_);
p->~T();
// Work around MSVC buggy unused parameter warning.