Skip to content

Commit b6136b3

Browse files
committed
---
yaml --- r: 135229 b: refs/heads/snap-stage3 c: 7409050 h: refs/heads/master i: 135227: 18da618 v: v3
1 parent 09ddc65 commit b6136b3

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 74090504219e4e37c1a6d9fdd8600f44b51c7b04
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1c36d1c71d0095d822ab03e7615fffc63fb16988
4+
refs/heads/snap-stage3: 74090504219e4e37c1a6d9fdd8600f44b51c7b04
55
refs/heads/try: 14378ea357c06c23607ca61ade44f60a7a64a1c7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/test/run-pass/realloc-16687.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ unsafe fn test_triangle() -> bool {
5656

5757
ret
5858
}
59+
unsafe fn deallocate(ptr: *mut u8, size: uint, align: uint) {
60+
if PRINT { println!("deallocate(ptr=0x{:010x} size={:u} align={:u})",
61+
ptr as uint, size, align);
62+
}
63+
64+
heap::deallocate(ptr, size, align);
65+
}
5966
unsafe fn reallocate(ptr: *mut u8, size: uint, align: uint,
6067
old_size: uint) -> *mut u8 {
6168
if PRINT {
@@ -95,10 +102,16 @@ unsafe fn test_triangle() -> bool {
95102
}
96103

97104
sanity_check(ascend.as_slice());
98-
test_1(ascend);
99-
test_2(ascend);
100-
test_3(ascend);
101-
test_4(ascend);
105+
test_1(ascend); // triangle -> square
106+
test_2(ascend); // square -> triangle
107+
test_3(ascend); // triangle -> square
108+
test_4(ascend); // square -> triangle
109+
110+
for i in range(0u, COUNT / 2) {
111+
let size = idx_to_size(i);
112+
deallocate(ascend[2*i], size, ALIGN);
113+
deallocate(ascend[2*i+1], size, ALIGN);
114+
}
102115

103116
return true;
104117

0 commit comments

Comments
 (0)