Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: src/heap/array-buffer-tracker.h

Issue 2870683003: [heap] Factor out marking state of array buffer tracker (Closed)
Patch Set: Get MarkingState out of thin air Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/array-buffer-tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/array-buffer-tracker.h
diff --git a/src/heap/array-buffer-tracker.h b/src/heap/array-buffer-tracker.h
index 3a57ab70cd0bb8201fc388efce4498f6ab213fbb..56f042780e71971b8e2508480003c07cd7ed3386 100644
--- a/src/heap/array-buffer-tracker.h
+++ b/src/heap/array-buffer-tracker.h
@@ -16,6 +16,7 @@ namespace internal {
class Heap;
class JSArrayBuffer;
+class MarkingState;
class Page;
class ArrayBufferTracker : public AllStatic {
@@ -40,7 +41,7 @@ class ArrayBufferTracker : public AllStatic {
// Frees all backing store pointers for dead JSArrayBuffer on a given page.
// Requires marking information to be present. Requires the page lock to be
// taken by the caller.
- static void FreeDead(Page* page);
+ static void FreeDead(Page* page, const MarkingState& marking_state);
// Frees all remaining, live or dead, array buffers on a page. Only useful
// during tear down.
@@ -71,9 +72,15 @@ class LocalArrayBufferTracker {
inline void Add(Key key, const Value& value);
inline Value Remove(Key key);
- // Frees up array buffers determined by |free_mode|.
- template <FreeMode free_mode>
- void Free();
+ // Frees up array buffers.
+ //
+ // Sample usage:
+ // Free([](HeapObject* array_buffer) {
+ // if (should_free_internal(array_buffer)) return true;
+ // return false;
+ // });
+ template <typename Callback>
+ void Free(Callback should_free);
// Processes buffers one by one. The CallbackResult of the callback decides
// what action to take on the buffer.
« no previous file with comments | « no previous file | src/heap/array-buffer-tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698