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

Side by Side Diff: runtime/vm/dart_api_state.cc

Issue 2650583014: Added tracking of memory usage within ApiNativeScopes. Usage to be displayed within Observatory. (Closed)
Patch Set: Added unit test + fixed typo Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/dart_api_state.h" 5 #include "vm/dart_api_state.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
11 #include "vm/lockers.h" 11 #include "vm/lockers.h"
12 #include "vm/thread.h" 12 #include "vm/thread.h"
13 #include "vm/timeline.h" 13 #include "vm/timeline.h"
14 14
15 namespace dart { 15 namespace dart {
16 16
17 intptr_t ApiNativeScope::current_memory_usage_ = 0;
18
17 BackgroundFinalizer::BackgroundFinalizer(Isolate* isolate, 19 BackgroundFinalizer::BackgroundFinalizer(Isolate* isolate,
18 FinalizationQueue* queue) 20 FinalizationQueue* queue)
19 : isolate_(isolate), queue_(queue) { 21 : isolate_(isolate), queue_(queue) {
20 ASSERT(FLAG_background_finalization); 22 ASSERT(FLAG_background_finalization);
21 PageSpace* old_space = isolate->heap()->old_space(); 23 PageSpace* old_space = isolate->heap()->old_space();
22 MonitorLocker ml(old_space->tasks_lock()); 24 MonitorLocker ml(old_space->tasks_lock());
23 old_space->set_tasks(old_space->tasks() + 1); 25 old_space->set_tasks(old_space->tasks() + 1);
24 } 26 }
25 27
26 28
(...skipping 17 matching lines...) Expand all
44 46
45 { 47 {
46 PageSpace* old_space = isolate_->heap()->old_space(); 48 PageSpace* old_space = isolate_->heap()->old_space();
47 MonitorLocker ml(old_space->tasks_lock()); 49 MonitorLocker ml(old_space->tasks_lock());
48 old_space->set_tasks(old_space->tasks() - 1); 50 old_space->set_tasks(old_space->tasks() - 1);
49 ml.NotifyAll(); 51 ml.NotifyAll();
50 } 52 }
51 } 53 }
52 54
53 } // namespace dart 55 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | runtime/vm/zone.cc » ('j') | runtime/vm/zone.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698