File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
branches/snap-stage3/src/test/run-pass Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 74090504219e4e37c1a6d9fdd8600f44b51c7b04
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 1c36d1c71d0095d822ab03e7615fffc63fb16988
4
+ refs/heads/snap-stage3: 74090504219e4e37c1a6d9fdd8600f44b51c7b04
5
5
refs/heads/try: 14378ea357c06c23607ca61ade44f60a7a64a1c7
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ unsafe fn test_triangle() -> bool {
56
56
57
57
ret
58
58
}
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
+ }
59
66
unsafe fn reallocate ( ptr : * mut u8 , size : uint , align : uint ,
60
67
old_size : uint ) -> * mut u8 {
61
68
if PRINT {
@@ -95,10 +102,16 @@ unsafe fn test_triangle() -> bool {
95
102
}
96
103
97
104
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 ( 0 u, 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
+ }
102
115
103
116
return true ;
104
117
You can’t perform that action at this time.
0 commit comments