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

Unified Diff: runtime/vm/thread_test.cc

Issue 2762323002: Reimplemented zone memory tracking to avoid race conditions that were causing crashes in the previo… (Closed)
Patch Set: Final change Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/thread.cc ('k') | runtime/vm/zone.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_test.cc
diff --git a/runtime/vm/thread_test.cc b/runtime/vm/thread_test.cc
index 790596982a137901e5d30cdb0ee504d03dedde00..f50b7abf40eb462e633150bb96aaf571173bc1ea 100644
--- a/runtime/vm/thread_test.cc
+++ b/runtime/vm/thread_test.cc
@@ -291,11 +291,10 @@ TEST_CASE(ManySimpleTasksWithZones) {
const int kTaskCount = 10;
Monitor monitor;
Monitor sync;
- Thread* threads[kTaskCount + 1];
+ Thread* threads[kTaskCount];
Isolate* isolate = Thread::Current()->isolate();
intptr_t done_count = 0;
bool wait = true;
- threads[kTaskCount] = Thread::Current();
EXPECT(isolate->heap()->GrowthControlState());
isolate->heap()->DisableGrowthControl();
@@ -323,23 +322,24 @@ TEST_CASE(ManySimpleTasksWithZones) {
Thread* current_thread = Thread::Current();
// Confirm all expected entries are in the JSON output.
- for (intptr_t i = 0; i < kTaskCount + 1; i++) {
+ for (intptr_t i = 0; i < kTaskCount; i++) {
Thread* thread = threads[i];
StackZone stack_zone(current_thread);
Zone* current_zone = current_thread->zone();
// Check the thread exists and is the correct size.
- char* thread_info_buf =
- OS::SCreate(current_zone,
- "\"type\":\"_Thread\","
- "\"id\":\"threads\\/%" Pd
- "\","
- "\"kind\":\"%s\","
- "\"_memoryHighWatermark\":\"%" Pu "\"",
- OSThread::ThreadIdToIntPtr(thread->os_thread()->trace_id()),
- Thread::TaskKindToCString(thread->task_kind()),
- thread->memory_high_watermark());
-
+ char* thread_info_buf = OS::SCreate(
+ current_zone,
+ "\"type\":\"_Thread\","
+ "\"id\":\"threads\\/%" Pd
+ "\","
+ "\"kind\":\"%s\","
+ "\"_zoneHighWatermark\":\"%" Pu
+ "\","
+ "\"_zoneCapacity\":\"%" Pu "\"",
+ OSThread::ThreadIdToIntPtr(thread->os_thread()->trace_id()),
+ Thread::TaskKindToCString(thread->task_kind()),
+ thread->zone_high_watermark(), thread->current_zone_capacity());
EXPECT_SUBSTRING(thread_info_buf, json);
}
« no previous file with comments | « runtime/vm/thread.cc ('k') | runtime/vm/zone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698