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

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

Issue 1071393003: Before write-protecting a PageSpace, return bump allocation block to freelist. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/pages.h » ('j') | runtime/vm/pages.cc » ('J')
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/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/heap.h" 10 #include "vm/heap.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 EXPECT(obj.raw() == heap->FindObject(&find_only)); 245 EXPECT(obj.raw() == heap->FindObject(&find_only));
246 } 246 }
247 } 247 }
248 { 248 {
249 NoSafepointScope no_safepoint; 249 NoSafepointScope no_safepoint;
250 FindNothing find_nothing; 250 FindNothing find_nothing;
251 EXPECT(Object::null() == heap->FindObject(&find_nothing)); 251 EXPECT(Object::null() == heap->FindObject(&find_nothing));
252 } 252 }
253 } 253 }
254 254
255
256 TEST_CASE(IterateReadOnly) {
257 const String& obj = String::Handle(String::New("x", Heap::kOld));
258 Heap* heap = Thread::Current()->isolate()->heap();
259 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw())));
260 heap->WriteProtect(true);
261 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw())));
262 heap->WriteProtect(false);
263 EXPECT(heap->Contains(RawObject::ToAddr(obj.raw())));
264 }
265
255 } // namespace dart. 266 } // namespace dart.
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/pages.h » ('j') | runtime/vm/pages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698