|
10 | 10 |
|
11 | 11 | // FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias`
|
12 | 12 |
|
13 |
| -#[cfg(stage0, not(test))] use core::raw; |
14 |
| -#[cfg(stage0, not(test))] use util; |
15 |
| - |
16 | 13 | /// Returns a pointer to `size` bytes of memory.
|
17 | 14 | ///
|
18 | 15 | /// Behavior is undefined if the requested size is 0 or the alignment is not a
|
@@ -111,21 +108,6 @@ unsafe fn exchange_free(ptr: *mut u8, size: uint, align: uint) {
|
111 | 108 | deallocate(ptr, size, align);
|
112 | 109 | }
|
113 | 110 |
|
114 |
| -#[cfg(stage0, not(test))] |
115 |
| -#[lang="closure_exchange_malloc"] |
116 |
| -#[inline] |
117 |
| -#[allow(deprecated)] |
118 |
| -unsafe fn closure_exchange_malloc(drop_glue: fn(*mut u8), size: uint, |
119 |
| - align: uint) -> *mut u8 { |
120 |
| - let total_size = util::get_box_size(size, align); |
121 |
| - let p = allocate(total_size, 8); |
122 |
| - |
123 |
| - let alloc = p as *mut raw::Box<()>; |
124 |
| - (*alloc).drop_glue = drop_glue; |
125 |
| - |
126 |
| - alloc as *mut u8 |
127 |
| -} |
128 |
| - |
129 | 111 | // The minimum alignment guaranteed by the architecture. This value is used to
|
130 | 112 | // add fast paths for low alignment values. In practice, the alignment is a
|
131 | 113 | // constant at the call site and the branch will be optimized out.
|
@@ -155,9 +137,6 @@ mod imp {
|
155 | 137 | flags: c_int) -> *mut c_void;
|
156 | 138 | fn je_xallocx(ptr: *mut c_void, size: size_t, extra: size_t,
|
157 | 139 | flags: c_int) -> size_t;
|
158 |
| - #[cfg(stage0)] |
159 |
| - fn je_dallocx(ptr: *mut c_void, flags: c_int); |
160 |
| - #[cfg(not(stage0))] |
161 | 140 | fn je_sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
|
162 | 141 | fn je_nallocx(size: size_t, flags: c_int) -> size_t;
|
163 | 142 | fn je_malloc_stats_print(write_cb: Option<extern "C" fn(cbopaque: *mut c_void,
|
@@ -209,14 +188,6 @@ mod imp {
|
209 | 188 | }
|
210 | 189 |
|
211 | 190 | #[inline]
|
212 |
| - #[cfg(stage0)] |
213 |
| - pub unsafe fn deallocate(ptr: *mut u8, _size: uint, align: uint) { |
214 |
| - let flags = align_to_flags(align); |
215 |
| - je_dallocx(ptr as *mut c_void, flags) |
216 |
| - } |
217 |
| - |
218 |
| - #[inline] |
219 |
| - #[cfg(not(stage0))] |
220 | 191 | pub unsafe fn deallocate(ptr: *mut u8, size: uint, align: uint) {
|
221 | 192 | let flags = align_to_flags(align);
|
222 | 193 | je_sdallocx(ptr as *mut c_void, size as size_t, flags)
|
|
0 commit comments