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

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

Issue 2570763002: Fixed bad calculations for determining total allocated size of a zone. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | runtime/vm/zone.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/isolate.h" 6 #include "vm/isolate.h"
7 #include "vm/lockers.h" 7 #include "vm/lockers.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 #include "vm/profiler.h" 9 #include "vm/profiler.h"
10 #include "vm/safepoint.h" 10 #include "vm/safepoint.h"
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 Zone* current_zone = current_thread->zone(); 330 Zone* current_zone = current_thread->zone();
331 331
332 // Check that all zones are present with correct sizes. 332 // Check that all zones are present with correct sizes.
333 while (top_zone != NULL) { 333 while (top_zone != NULL) {
334 char* zone_info_buf = 334 char* zone_info_buf =
335 OS::SCreate(current_zone, 335 OS::SCreate(current_zone,
336 "\"type\":\"_Zone\"," 336 "\"type\":\"_Zone\","
337 "\"capacity\":%" Pd 337 "\"capacity\":%" Pd
338 "," 338 ","
339 "\"used\":%" Pd "", 339 "\"used\":%" Pd "",
340 top_zone->SizeInBytes(), top_zone->UsedSizeInBytes()); 340 top_zone->CapacityInBytes(), top_zone->SizeInBytes());
341 EXPECT_SUBSTRING(zone_info_buf, json); 341 EXPECT_SUBSTRING(zone_info_buf, json);
342 top_zone = top_zone->previous(); 342 top_zone = top_zone->previous();
343 } 343 }
344 344
345 // Check the thread exists and is the correct size. 345 // Check the thread exists and is the correct size.
346 char* thread_info_buf = 346 char* thread_info_buf =
347 OS::SCreate(current_zone, 347 OS::SCreate(current_zone,
348 "\"type\":\"_Thread\"," 348 "\"type\":\"_Thread\","
349 "\"id\":\"threads\\/%" Pd 349 "\"id\":\"threads\\/%" Pd
350 "\"," 350 "\","
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 TransitionVMToBlocked transition(thread); 792 TransitionVMToBlocked transition(thread);
793 MonitorLocker ml(&done_monitor); 793 MonitorLocker ml(&done_monitor);
794 if (done) { 794 if (done) {
795 break; 795 break;
796 } 796 }
797 } 797 }
798 } 798 }
799 } 799 }
800 800
801 } // namespace dart 801 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/zone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698