@@ -80,8 +80,7 @@ pub fn is_not_null<T>(ptr: *const T) -> bool { !is_null(ptr) }
80
80
#[ inline]
81
81
#[ cfg( target_word_size = "32" ) ]
82
82
pub unsafe fn copy_memory < T > ( dst : * mut T , src : * const T , count : uint ) {
83
- use unstable:: intrinsics:: memmove32;
84
- memmove32 ( dst, src as * T , count as u32 ) ;
83
+ intrinsics:: memmove32 ( dst, src as * T , count as u32 ) ;
85
84
}
86
85
87
86
/**
@@ -93,8 +92,7 @@ pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
93
92
#[ inline]
94
93
#[ cfg( target_word_size = "64" ) ]
95
94
pub unsafe fn copy_memory < T > ( dst : * mut T , src : * const T , count : uint ) {
96
- use unstable:: intrinsics:: memmove64;
97
- memmove64 ( dst, src as * T , count as u64 ) ;
95
+ intrinsics:: memmove64 ( dst, src as * T , count as u64 ) ;
98
96
}
99
97
100
98
/**
@@ -106,8 +104,7 @@ pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
106
104
#[ inline]
107
105
#[ cfg( target_word_size = "32" ) ]
108
106
pub unsafe fn copy_nonoverlapping_memory < T > ( dst : * mut T , src : * const T , count : uint ) {
109
- use unstable:: intrinsics:: memcpy32;
110
- memcpy32 ( dst, src as * T , count as u32 ) ;
107
+ intrinsics:: memcpy32 ( dst, src as * T , count as u32 ) ;
111
108
}
112
109
113
110
/**
@@ -119,8 +116,7 @@ pub unsafe fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: u
119
116
#[ inline]
120
117
#[ cfg( target_word_size = "64" ) ]
121
118
pub unsafe fn copy_nonoverlapping_memory < T > ( dst : * mut T , src : * const T , count : uint ) {
122
- use unstable:: intrinsics:: memcpy64;
123
- memcpy64 ( dst, src as * T , count as u64 ) ;
119
+ intrinsics:: memcpy64 ( dst, src as * T , count as u64 ) ;
124
120
}
125
121
126
122
/**
@@ -130,8 +126,7 @@ pub unsafe fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: u
130
126
#[ inline]
131
127
#[ cfg( target_word_size = "32" ) ]
132
128
pub unsafe fn set_memory < T > ( dst : * mut T , c : u8 , count : uint ) {
133
- use unstable:: intrinsics:: memset32;
134
- memset32 ( dst, c, count as u32 ) ;
129
+ intrinsics:: memset32 ( dst, c, count as u32 ) ;
135
130
}
136
131
137
132
/**
@@ -141,34 +136,17 @@ pub unsafe fn set_memory<T>(dst: *mut T, c: u8, count: uint) {
141
136
#[ inline]
142
137
#[ cfg( target_word_size = "64" ) ]
143
138
pub unsafe fn set_memory < T > ( dst : * mut T , c : u8 , count : uint ) {
144
- use unstable:: intrinsics:: memset64;
145
- memset64 ( dst, c, count as u64 ) ;
139
+ intrinsics:: memset64 ( dst, c, count as u64 ) ;
146
140
}
147
141
148
142
/**
149
143
* Zeroes out `count * size_of::<T>` bytes of memory at `dst`
150
144
*/
151
145
#[ inline]
152
- #[ cfg( not( stage0) ) ]
153
146
pub unsafe fn zero_memory < T > ( dst : * mut T , count : uint ) {
154
147
set_memory ( dst, 0 , count) ;
155
148
}
156
149
157
- /**
158
- * Zeroes out `count * size_of::<T>` bytes of memory at `dst`
159
- */
160
- #[ inline]
161
- #[ cfg( stage0) ]
162
- pub unsafe fn zero_memory < T > ( dst : * mut T , count : uint ) {
163
- let mut count = count * sys:: size_of :: < T > ( ) ;
164
- let mut dst = dst as * mut u8 ;
165
- while count > 0 {
166
- * dst = 0 ;
167
- dst = mut_offset ( dst, 1 ) ;
168
- count -= 1 ;
169
- }
170
- }
171
-
172
150
/**
173
151
* Swap the values at two mutable locations of the same type, without
174
152
* deinitialising or copying either one.
0 commit comments