Index: src/heap/array-buffer-tracker.cc |
diff --git a/src/heap/array-buffer-tracker.cc b/src/heap/array-buffer-tracker.cc |
index d7bbb941e2ca726985863a284fbf4129d97bc1af..c4ad3ba2c771057211a152f376524cc7e2bbdc09 100644 |
--- a/src/heap/array-buffer-tracker.cc |
+++ b/src/heap/array-buffer-tracker.cc |
@@ -19,7 +19,10 @@ void LocalArrayBufferTracker::Free() { |
for (TrackingData::iterator it = array_buffers_.begin(); |
it != array_buffers_.end();) { |
JSArrayBuffer* buffer = reinterpret_cast<JSArrayBuffer*>(it->first); |
- if ((free_mode == kFreeAll) || ObjectMarking::IsWhite(buffer)) { |
+ // TODO(mlippautz): Create a dependency on the collector to avoid getting |
+ // the marking state out of thin air. |
+ if ((free_mode == kFreeAll) || |
+ ObjectMarking::IsWhite(buffer, MarkingState::Internal(buffer))) { |
const size_t len = it->second; |
heap_->isolate()->array_buffer_allocator()->Free(buffer->backing_store(), |
len); |