summaryrefslogtreecommitdiffhomepage
path: root/dev/lib/memory
diff options
context:
space:
mode:
Diffstat (limited to 'dev/lib/memory')
-rw-r--r--dev/lib/memory/tracked_ptr.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/dev/lib/memory/tracked_ptr.hpp b/dev/lib/memory/tracked_ptr.hpp
index 1ff4cca..61ad685 100644
--- a/dev/lib/memory/tracked_ptr.hpp
+++ b/dev/lib/memory/tracked_ptr.hpp
@@ -12,6 +12,10 @@
#include <memory>
#include <atomic>
+#include <sys/types.h>
+#include <unistd.h>
+#include <signal.h>
+
namespace snu::memory
{
template <typename T>
@@ -211,6 +215,9 @@ namespace snu::memory
template <typename T>
inline void must_pass(tracked_ptr<T>& ptr) noexcept
{
- assert(ptr.manager().allocator().allocated_count_ < ptr.manager().allocator().deallocated_count_);
+ if (ptr.manager().allocator().allocated_count_ < ptr.manager().allocator().deallocated_count_)
+ {
+ ::kill(::getpid(), SIGTRAP);
+ }
}
} // namespace snu::memory \ No newline at end of file