Chromium Code Reviews| Index: runtime/vm/thread.h |
| diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h |
| index 576d57c19d1e637908acb34d5fd4a7c721f421cb..05580ecb388f328d4cbed2dedcdd527ab674a176 100644 |
| --- a/runtime/vm/thread.h |
| +++ b/runtime/vm/thread.h |
| @@ -264,6 +264,26 @@ class Thread : public BaseThread { |
| bool ZoneIsOwnedByThread(Zone* zone) const; |
| + void IncrementThreadMemoryUsage(intptr_t value) { |
| + current_thread_memory_ += value; |
| + if (current_thread_memory_ > thread_memory_high_watermark_) { |
| + thread_memory_high_watermark_ = current_thread_memory_; |
| + } |
| + } |
| + |
| + void DecrementThreadMemoryUsage(intptr_t value) { |
| + ASSERT(current_thread_memory_ >= value); |
| + current_thread_memory_ -= value; |
| + } |
| + |
| + intptr_t GetThreadHighWatermark() const { |
|
Cutch
2017/01/03 20:58:54
simple getters use lower_case_names()
bkonyi
2017/01/03 22:00:38
Done.
|
| + return thread_memory_high_watermark_; |
| + } |
| + |
| + void ResetHighWatermark() { |
| + thread_memory_high_watermark_ = current_thread_memory_; |
| + } |
| + |
| // The reusable api local scope for this thread. |
| ApiLocalScope* api_reusable_scope() const { return api_reusable_scope_; } |
| void set_api_reusable_scope(ApiLocalScope* value) { |
| @@ -679,6 +699,8 @@ class Thread : public BaseThread { |
| OSThread* os_thread_; |
| Monitor* thread_lock_; |
| Zone* zone_; |
| + intptr_t current_thread_memory_; |
| + intptr_t thread_memory_high_watermark_; |
| ApiLocalScope* api_reusable_scope_; |
| ApiLocalScope* api_top_scope_; |
| StackResource* top_resource_; |