wip: improving tracking of allocation locations

This commit is contained in:
daan 2020-02-11 20:27:09 -08:00
parent 21a95c7449
commit 2fbe0e8842
9 changed files with 393 additions and 447 deletions

View file

@ -47,6 +47,15 @@ terms of the MIT license. A copy of the license can be found in the file
void* operator new (std::size_t n, std::align_val_t al, const std::nothrow_t&) noexcept { return mi_source_new_aligned_nothrow(n, static_cast<size_t>(al) MI_SOURCE_RET()); }
void* operator new[](std::size_t n, std::align_val_t al, const std::nothrow_t&) noexcept { return mi_source_new_aligned_nothrow(n, static_cast<size_t>(al) MI_SOURCE_RET()); }
#endif
// Instances for debug override of the new operator
#ifndef NDEBUG
void* operator new(std::size_t n MI_SOURCE_PARAM) noexcept(false) { return mi_source_new(n MI_SOURCE_ARG); }
void* operator new[](std::size_t n MI_SOURCE_PARAM) noexcept(false) { return mi_source_new(n MI_SOURCE_ARG); }
void operator delete(void* p MI_SOURCE_PARAM) noexcept { mi_free(p); };
void operator delete[](void* p MI_SOURCE_PARAM) noexcept { mi_free(p); };
#endif
#endif
#endif // MIMALLOC_NEW_DELETE_H