summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Heap/Heap.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-23 13:45:01 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-23 13:45:01 +0100
commit1dd71bd68f85c3263ec3a2ee4c735e9cc189af6b (patch)
treefb06f0a45714e3665b185904fafaac1d913e9965 /Libraries/LibJS/Heap/Heap.cpp
parente31dac3ba4985e940eaea0b6700a091aaaac4ced (diff)
downloadserenity-1dd71bd68f85c3263ec3a2ee4c735e9cc189af6b.zip
LibJS: Put some more Heap debug logging behind HEAP_DEBUG
Diffstat (limited to 'Libraries/LibJS/Heap/Heap.cpp')
-rw-r--r--Libraries/LibJS/Heap/Heap.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Libraries/LibJS/Heap/Heap.cpp b/Libraries/LibJS/Heap/Heap.cpp
index 905f52e0e5..4ad48b5a97 100644
--- a/Libraries/LibJS/Heap/Heap.cpp
+++ b/Libraries/LibJS/Heap/Heap.cpp
@@ -35,9 +35,9 @@
#include <stdio.h>
#ifdef __serenity__
-#include <serenity.h>
+# include <serenity.h>
#elif __linux__
-#include <pthread.h>
+# include <pthread.h>
#endif
#define HEAP_DEBUG
@@ -229,13 +229,17 @@ void Heap::sweep_dead_cells()
}
for (auto* block : empty_blocks) {
+#ifdef HEAP_DEBUG
dbg() << " - Reclaim HeapBlock @ " << block << ": cell_size=" << block->cell_size();
+#endif
m_blocks.remove_first_matching([block](auto& entry) { return entry == block; });
}
+#ifdef HEAP_DEBUG
for (auto& block : m_blocks) {
dbg() << " > Live HeapBlock @ " << block << ": cell_size=" << block->cell_size();
}
+#endif
}
void Heap::did_create_handle(Badge<HandleImpl>, HandleImpl& impl)