| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/thread_registry.h" | 5 #include "vm/thread_registry.h" |
| 6 | 6 |
| 7 #include "vm/isolate.h" | 7 #include "vm/isolate.h" |
| 8 #include "vm/json_stream.h" | 8 #include "vm/json_stream.h" |
| 9 #include "vm/lockers.h" | 9 #include "vm/lockers.h" |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 ASSERT(thread != NULL); | 188 ASSERT(thread != NULL); |
| 189 ASSERT(thread->os_thread_ == NULL); | 189 ASSERT(thread->os_thread_ == NULL); |
| 190 ASSERT(thread->isolate_ == NULL); | 190 ASSERT(thread->isolate_ == NULL); |
| 191 ASSERT(thread->heap_ == NULL); | 191 ASSERT(thread->heap_ == NULL); |
| 192 ASSERT(threads_lock()->IsOwnedByCurrentThread()); | 192 ASSERT(threads_lock()->IsOwnedByCurrentThread()); |
| 193 // Add thread to the free list. | 193 // Add thread to the free list. |
| 194 thread->next_ = free_list_; | 194 thread->next_ = free_list_; |
| 195 free_list_ = thread; | 195 free_list_ = thread; |
| 196 } | 196 } |
| 197 | 197 |
| 198 | |
| 199 uintptr_t ThreadRegistry::ThreadHighWatermarksTotalLocked() const { | |
| 200 ASSERT(threads_lock()->IsOwnedByCurrentThread()); | |
| 201 uintptr_t memory_high_watermarks_total = 0; | |
| 202 Thread* current = active_list_; | |
| 203 while (current != NULL) { | |
| 204 memory_high_watermarks_total += current->memory_high_watermark(); | |
| 205 current = current->next_; | |
| 206 } | |
| 207 return memory_high_watermarks_total; | |
| 208 } | |
| 209 | |
| 210 } // namespace dart | 198 } // namespace dart |
| OLD | NEW |