@@ -87,7 +87,7 @@ pub fn is_not_null<T,P:RawPtr<T>>(ptr: P) -> bool { ptr.is_not_null() }
87
87
* and destination may overlap.
88
88
*/
89
89
#[ inline]
90
- #[ cfg( target_word_size = "32" ) ]
90
+ #[ cfg( target_word_size = "32" , stage0 ) ]
91
91
pub unsafe fn copy_memory < T , P : RawPtr < T > > ( dst : * mut T , src : P , count : uint ) {
92
92
intrinsics:: memmove32 ( dst,
93
93
cast:: transmute_immut_unsafe ( src) ,
@@ -101,21 +101,33 @@ pub unsafe fn copy_memory<T,P:RawPtr<T>>(dst: *mut T, src: P, count: uint) {
101
101
* and destination may overlap.
102
102
*/
103
103
#[ inline]
104
- #[ cfg( target_word_size = "64" ) ]
104
+ #[ cfg( target_word_size = "64" , stage0 ) ]
105
105
pub unsafe fn copy_memory < T , P : RawPtr < T > > ( dst : * mut T , src : P , count : uint ) {
106
106
intrinsics:: memmove64 ( dst,
107
107
cast:: transmute_immut_unsafe ( src) ,
108
108
count as u64 ) ;
109
109
}
110
110
111
+ /**
112
+ * Copies data from one location to another.
113
+ *
114
+ * Copies `count` elements (not bytes) from `src` to `dst`. The source
115
+ * and destination may overlap.
116
+ */
117
+ #[ inline]
118
+ #[ cfg( not( stage0) ) ]
119
+ pub unsafe fn copy_memory < T , P : RawPtr < T > > ( dst : * mut T , src : P , count : uint ) {
120
+ intrinsics:: copy_memory ( dst, cast:: transmute_immut_unsafe ( src) , count)
121
+ }
122
+
111
123
/**
112
124
* Copies data from one location to another.
113
125
*
114
126
* Copies `count` elements (not bytes) from `src` to `dst`. The source
115
127
* and destination may *not* overlap.
116
128
*/
117
129
#[ inline]
118
- #[ cfg( target_word_size = "32" ) ]
130
+ #[ cfg( target_word_size = "32" , stage0 ) ]
119
131
pub unsafe fn copy_nonoverlapping_memory < T , P : RawPtr < T > > ( dst : * mut T ,
120
132
src : P ,
121
133
count : uint ) {
@@ -131,7 +143,7 @@ pub unsafe fn copy_nonoverlapping_memory<T,P:RawPtr<T>>(dst: *mut T,
131
143
* and destination may *not* overlap.
132
144
*/
133
145
#[ inline]
134
- #[ cfg( target_word_size = "64" ) ]
146
+ #[ cfg( target_word_size = "64" , stage0 ) ]
135
147
pub unsafe fn copy_nonoverlapping_memory < T , P : RawPtr < T > > ( dst : * mut T ,
136
148
src : P ,
137
149
count : uint ) {
@@ -140,12 +152,26 @@ pub unsafe fn copy_nonoverlapping_memory<T,P:RawPtr<T>>(dst: *mut T,
140
152
count as u64 ) ;
141
153
}
142
154
155
+ /**
156
+ * Copies data from one location to another.
157
+ *
158
+ * Copies `count` elements (not bytes) from `src` to `dst`. The source
159
+ * and destination may *not* overlap.
160
+ */
161
+ #[ inline]
162
+ #[ cfg( not( stage0) ) ]
163
+ pub unsafe fn copy_nonoverlapping_memory < T , P : RawPtr < T > > ( dst : * mut T ,
164
+ src : P ,
165
+ count : uint ) {
166
+ intrinsics:: copy_nonoverlapping_memory ( dst, cast:: transmute_immut_unsafe ( src) , count)
167
+ }
168
+
143
169
/**
144
170
* Invokes memset on the specified pointer, setting `count * size_of::<T>()`
145
171
* bytes of memory starting at `dst` to `c`.
146
172
*/
147
173
#[ inline]
148
- #[ cfg( target_word_size = "32" ) ]
174
+ #[ cfg( target_word_size = "32" , stage0 ) ]
149
175
pub unsafe fn set_memory < T > ( dst : * mut T , c : u8 , count : uint ) {
150
176
intrinsics:: memset32 ( dst, c, count as u32 ) ;
151
177
}
@@ -155,11 +181,21 @@ pub unsafe fn set_memory<T>(dst: *mut T, c: u8, count: uint) {
155
181
* bytes of memory starting at `dst` to `c`.
156
182
*/
157
183
#[ inline]
158
- #[ cfg( target_word_size = "64" ) ]
184
+ #[ cfg( target_word_size = "64" , stage0 ) ]
159
185
pub unsafe fn set_memory < T > ( dst : * mut T , c : u8 , count : uint ) {
160
186
intrinsics:: memset64 ( dst, c, count as u64 ) ;
161
187
}
162
188
189
+ /**
190
+ * Invokes memset on the specified pointer, setting `count * size_of::<T>()`
191
+ * bytes of memory starting at `dst` to `c`.
192
+ */
193
+ #[ inline]
194
+ #[ cfg( not( stage0) ) ]
195
+ pub unsafe fn set_memory < T > ( dst : * mut T , c : u8 , count : uint ) {
196
+ intrinsics:: set_memory ( dst, c, count)
197
+ }
198
+
163
199
/**
164
200
* Zeroes out `count * size_of::<T>` bytes of memory at `dst`
165
201
*/
0 commit comments