Commit a5c7137e authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

heap: Actually attach allocation tracker

Bug: v8:12616, v8:12615
Change-Id: I57ce784c4c9b7a9d75a6e139063b7ce0cac511ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3452024Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79033}
parent 1e6294d3
...@@ -721,14 +721,16 @@ class Heap::AllocationTrackerForDebugging final ...@@ -721,14 +721,16 @@ class Heap::AllocationTrackerForDebugging final
public: public:
static bool IsNeeded() { static bool IsNeeded() {
return FLAG_verify_predictable || FLAG_fuzzer_gc_analysis || return FLAG_verify_predictable || FLAG_fuzzer_gc_analysis ||
FLAG_trace_allocation_stack_interval; (FLAG_trace_allocation_stack_interval > 0);
} }
explicit AllocationTrackerForDebugging(Heap* heap) : heap_(heap) { explicit AllocationTrackerForDebugging(Heap* heap) : heap_(heap) {
CHECK(IsNeeded()); CHECK(IsNeeded());
heap_->AddHeapObjectAllocationTracker(this);
} }
~AllocationTrackerForDebugging() final { ~AllocationTrackerForDebugging() final {
heap_->RemoveHeapObjectAllocationTracker(this);
if (FLAG_verify_predictable || FLAG_fuzzer_gc_analysis) { if (FLAG_verify_predictable || FLAG_fuzzer_gc_analysis) {
PrintAllocationsHash(); PrintAllocationsHash();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment