mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Revert "Auto merge of #17633 - servo:rustup, r=nox"
This reverts commit327e72aa14
, reversing changes made toeec51cdd57
.
This commit is contained in:
parent
e24d81dbe7
commit
dc28d6244c
3 changed files with 10 additions and 13 deletions
|
@ -3,9 +3,11 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// For SIMD
|
// For SIMD
|
||||||
#![cfg_attr(any(target_os = "linux", target_os = "android"), feature(alloc, allocator_api))]
|
|
||||||
#![feature(box_syntax)]
|
|
||||||
#![feature(cfg_target_feature)]
|
#![feature(cfg_target_feature)]
|
||||||
|
#![cfg_attr(any(target_os = "linux", target_os = "android"), feature(heap_api))]
|
||||||
|
|
||||||
|
#![cfg_attr(any(target_os = "linux", target_os = "android"), feature(alloc))]
|
||||||
|
#![feature(box_syntax)]
|
||||||
#![feature(range_contains)]
|
#![feature(range_contains)]
|
||||||
#![feature(unique)]
|
#![feature(unique)]
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use alloc::allocator::{Alloc, Layout};
|
use alloc::heap;
|
||||||
use alloc::heap::Heap;
|
|
||||||
use freetype::freetype::FT_Add_Default_Modules;
|
use freetype::freetype::FT_Add_Default_Modules;
|
||||||
use freetype::freetype::FT_Done_Library;
|
use freetype::freetype::FT_Done_Library;
|
||||||
use freetype::freetype::FT_Library;
|
use freetype::freetype::FT_Library;
|
||||||
|
@ -27,8 +26,7 @@ const FT_ALIGNMENT: usize = 1;
|
||||||
|
|
||||||
extern fn ft_alloc(mem: FT_Memory, req_size: c_long) -> *mut c_void {
|
extern fn ft_alloc(mem: FT_Memory, req_size: c_long) -> *mut c_void {
|
||||||
unsafe {
|
unsafe {
|
||||||
let layout = Layout::from_size_align(req_size as usize, FT_ALIGNMENT).unwrap();
|
let ptr = heap::allocate(req_size as usize, FT_ALIGNMENT) as *mut c_void;
|
||||||
let ptr = Heap.alloc(layout).unwrap() as *mut c_void;
|
|
||||||
let actual_size = heap_size_of(ptr as *const _);
|
let actual_size = heap_size_of(ptr as *const _);
|
||||||
|
|
||||||
let user = (*mem).user as *mut User;
|
let user = (*mem).user as *mut User;
|
||||||
|
@ -45,8 +43,7 @@ extern fn ft_free(mem: FT_Memory, ptr: *mut c_void) {
|
||||||
let user = (*mem).user as *mut User;
|
let user = (*mem).user as *mut User;
|
||||||
(*user).size -= actual_size;
|
(*user).size -= actual_size;
|
||||||
|
|
||||||
let layout = Layout::from_size_align(actual_size, FT_ALIGNMENT).unwrap();
|
heap::deallocate(ptr as *mut u8, actual_size, FT_ALIGNMENT);
|
||||||
Heap.dealloc(ptr as *mut u8, layout);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,10 +51,8 @@ extern fn ft_realloc(mem: FT_Memory, _cur_size: c_long, new_req_size: c_long,
|
||||||
old_ptr: *mut c_void) -> *mut c_void {
|
old_ptr: *mut c_void) -> *mut c_void {
|
||||||
unsafe {
|
unsafe {
|
||||||
let old_actual_size = heap_size_of(old_ptr as *const _);
|
let old_actual_size = heap_size_of(old_ptr as *const _);
|
||||||
let old_layout = Layout::from_size_align(old_actual_size, FT_ALIGNMENT).unwrap();
|
let new_ptr = heap::reallocate(old_ptr as *mut u8, old_actual_size,
|
||||||
let new_layout = Layout::from_size_align(new_req_size as usize, FT_ALIGNMENT).unwrap();
|
new_req_size as usize, FT_ALIGNMENT) as *mut c_void;
|
||||||
let result = Heap.realloc(old_ptr as *mut u8, old_layout, new_layout);
|
|
||||||
let new_ptr = result.unwrap() as *mut c_void;
|
|
||||||
let new_actual_size = heap_size_of(new_ptr as *const _);
|
let new_actual_size = heap_size_of(new_ptr as *const _);
|
||||||
|
|
||||||
let user = (*mem).user as *mut User;
|
let user = (*mem).user as *mut User;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
696412de7e4e119f8536686c643621115b90c775
|
3bfc18a9619a5151ff4f11618db9cd882996ba6f
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue