| Index: src/heap/heap.h
|
| diff --git a/src/heap/heap.h b/src/heap/heap.h
|
| index d9ac1556b51dcf0c3466afa884a0004c640ec0c3..aaddcb9a5d6fefcb6829b5eca3c0f248e9495848 100644
|
| --- a/src/heap/heap.h
|
| +++ b/src/heap/heap.h
|
| @@ -1175,6 +1175,14 @@ class Heap {
|
| // completes incremental marking in order to free external resources.
|
| void ReportExternalMemoryPressure();
|
|
|
| + typedef v8::Isolate::GetExternallyAllocatedMemoryInBytesCallback
|
| + GetExternallyAllocatedMemoryInBytesCallback;
|
| +
|
| + void SetGetExternallyAllocatedMemoryInBytesCallback(
|
| + GetExternallyAllocatedMemoryInBytesCallback callback) {
|
| + external_memory_callback_ = callback;
|
| + }
|
| +
|
| // Invoked when GC was requested via the stack guard.
|
| void HandleGCRequest();
|
|
|
| @@ -1664,6 +1672,10 @@ class Heap {
|
| return (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE;
|
| }
|
|
|
| + static size_t DefaultGetExternallyAllocatedMemoryInBytesCallback() {
|
| + return 0;
|
| + }
|
| +
|
| #define ROOT_ACCESSOR(type, name, camel_name) \
|
| inline void set_##name(type* value);
|
| ROOT_LIST(ROOT_ACCESSOR)
|
| @@ -2282,6 +2294,8 @@ class Heap {
|
| List<GCCallbackPair> gc_epilogue_callbacks_;
|
| List<GCCallbackPair> gc_prologue_callbacks_;
|
|
|
| + GetExternallyAllocatedMemoryInBytesCallback external_memory_callback_;
|
| +
|
| int deferred_counters_[v8::Isolate::kUseCounterFeatureCount];
|
|
|
| GCTracer* tracer_;
|
|
|