Skip to content

Commit

Permalink
Fix alloc_system to use new allocator_api
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Oct 21, 2017
1 parent 859cc35 commit 6994b4e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions imageflow_abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
//! For all APIS: You'll likely segfault the process if you provide a `context` pointer that is dangling or invalid.
//!
#![crate_type = "cdylib"]
#![feature(alloc_system)]
#![feature(core_intrinsics)]

// These functions are not for use from Rust, so marking them unsafe just reduces compile-time verification and safety
Expand All @@ -119,9 +118,7 @@

#[macro_use]
extern crate imageflow_core as c;
#[cfg_attr(feature = "cargo-clippy", allow(useless_attribute))]
#[allow(unused_extern_crates)]
extern crate alloc_system;

extern crate libc;
extern crate smallvec;
extern crate backtrace;
Expand Down
6 changes: 1 addition & 5 deletions imageflow_core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![feature(concat_idents)]
#![feature(alloc)]
#![feature(oom)]
#![feature(alloc_system)]
#![feature(conservative_impl_trait)]
#![feature(proc_macro)]
#![feature(integer_atomics)]
Expand All @@ -18,9 +16,7 @@
#![allow(unused_imports)]
#![allow(dead_code)]
#![allow(unused_variables)]
#[cfg_attr(feature = "cargo-clippy", allow(useless_attribute))]
#[allow(unused_extern_crates)]
extern crate alloc_system;

extern crate petgraph;
extern crate daggy;
extern crate imageflow_types;
Expand Down
28 changes: 24 additions & 4 deletions imageflow_helpers/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
#![feature(alloc_system)]
#![feature(global_allocator, allocator_api, heap_api)]

#![feature(integer_atomics)]
#![feature(ascii_ctype)]
#![feature(i128_type)] // Not used heavily, removable
// `error_chain!` can recurse deeply
#![recursion_limit = "1024"]

//hexadecimal colors aren't numbers
#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]

#[cfg_attr(feature = "cargo-clippy", allow(useless_attribute))]
#[allow(unused_extern_crates)]
extern crate alloc_system;

//
//use std::heap::{Alloc, System, Layout, AllocErr};
//
//struct MyAllocator;
//
//unsafe impl<'a> Alloc for &'a MyAllocator {
// unsafe fn alloc(&mut self, layout: Layout) -> Result<*mut u8, AllocErr> {
// System.alloc(layout)
// }
//
// unsafe fn dealloc(&mut self, ptr: *mut u8, layout: Layout) {
// System.dealloc(ptr, layout)
// }
//}

#[global_allocator]
static GLOBAL: ::std::heap::System = ::std::heap::System;




#[macro_use]
extern crate error_chain;
Expand Down
5 changes: 1 addition & 4 deletions imageflow_riapi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#![feature(conservative_impl_trait)]
#![feature(alloc_system)]
#[cfg_attr(feature = "cargo-clippy", allow(useless_attribute))]
#[allow(unused_extern_crates)]
extern crate alloc_system;


#[macro_use] extern crate macro_attr;
#[macro_use] extern crate enum_derive;
Expand Down
5 changes: 1 addition & 4 deletions imageflow_tool/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#![feature(slice_concat_ext)]
#![feature(alloc_system)]
#[cfg_attr(feature = "cargo-clippy", allow(useless_attribute))]
#[allow(unused_extern_crates)]
extern crate alloc_system;


extern crate clap;
extern crate imageflow_helpers;
Expand Down
5 changes: 1 addition & 4 deletions imageflow_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@

#![feature(proc_macro)]
#![feature(conservative_impl_trait)]
#![feature(alloc_system)]
#[cfg_attr(feature = "cargo-clippy", allow(useless_attribute))]
#[allow(unused_extern_crates)]
extern crate alloc_system;

pub mod build_env_info;
pub mod version;

Expand Down

0 comments on commit 6994b4e

Please sign in to comment.