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

Unified Diff: runtime/vm/freelist_test.cc

Issue 106593002: Write protect executable pages in the VM. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/freelist.cc ('k') | runtime/vm/instructions_arm_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/freelist_test.cc
diff --git a/runtime/vm/freelist_test.cc b/runtime/vm/freelist_test.cc
index a64ce34f7fbf43dbce6d8358ae3cb03571a9d034..fc506d76d1c2220637e965b49d7421f8151fb5ab 100644
--- a/runtime/vm/freelist_test.cc
+++ b/runtime/vm/freelist_test.cc
@@ -18,32 +18,33 @@ TEST_CASE(FreeList) {
// Enqueue the large blob as one free block.
free_list->Free(blob, kBlobSize);
// Allocate a small object. Expect it to be positioned as the first element.
- uword small_object = free_list->TryAllocate(kSmallObjectSize);
+ uword small_object = free_list->TryAllocate(kSmallObjectSize, false);
EXPECT_EQ(blob, small_object);
// Freeing and allocating should give us the same memory back.
free_list->Free(small_object, kSmallObjectSize);
- small_object = free_list->TryAllocate(kSmallObjectSize);
+ small_object = free_list->TryAllocate(kSmallObjectSize, false);
EXPECT_EQ(blob, small_object);
// Splitting the remainder further with small and medium objects.
- uword small_object2 = free_list->TryAllocate(kSmallObjectSize);
+ uword small_object2 = free_list->TryAllocate(kSmallObjectSize, false);
EXPECT_EQ(blob + kSmallObjectSize, small_object2);
- uword med_object = free_list->TryAllocate(kMediumObjectSize);
+ uword med_object = free_list->TryAllocate(kMediumObjectSize, false);
EXPECT_EQ(small_object2 + kSmallObjectSize, med_object);
// Allocate a large object.
- uword large_object = free_list->TryAllocate(kLargeObjectSize);
+ uword large_object = free_list->TryAllocate(kLargeObjectSize, false);
EXPECT_EQ(med_object + kMediumObjectSize, large_object);
// Make sure that small objects can still split the remainder.
- uword small_object3 = free_list->TryAllocate(kSmallObjectSize);
+ uword small_object3 = free_list->TryAllocate(kSmallObjectSize, false);
EXPECT_EQ(large_object + kLargeObjectSize, small_object3);
// Split the large object.
free_list->Free(large_object, kLargeObjectSize);
- uword small_object4 = free_list->TryAllocate(kSmallObjectSize);
+ uword small_object4 = free_list->TryAllocate(kSmallObjectSize, false);
EXPECT_EQ(large_object, small_object4);
// Get the full remainder of the large object.
- large_object = free_list->TryAllocate(kLargeObjectSize - kSmallObjectSize);
+ large_object =
+ free_list->TryAllocate(kLargeObjectSize - kSmallObjectSize, false);
EXPECT_EQ(small_object4 + kSmallObjectSize, large_object);
// Get another large object from the large unallocated remainder.
- uword large_object2 = free_list->TryAllocate(kLargeObjectSize);
+ uword large_object2 = free_list->TryAllocate(kLargeObjectSize, false);
EXPECT_EQ(small_object3 + kSmallObjectSize, large_object2);
// Delete the memory associated with the test.
free(reinterpret_cast<void*>(blob));
« no previous file with comments | « runtime/vm/freelist.cc ('k') | runtime/vm/instructions_arm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698