Skip to content

Removed libc dependency #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ members = ["libmimalloc-sys" ]
travis-ci = { repository = "purpleprotocol/mimalloc_rust" }

[dependencies]
libc = "0.2"
libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.10" }

[features]
Expand Down
1 change: 0 additions & 1 deletion libmimalloc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ description = "Sys crate wrapping the mimalloc allocator"
license = "MIT"

[dependencies]
libc = "0.2"

[build-dependencies]
cmake = "0.1"
Expand Down
14 changes: 7 additions & 7 deletions libmimalloc-sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright 2019 Octavian Oncescu

use libc::{c_void, size_t};
use core::ffi::c_void;

extern "C" {
pub fn mi_zalloc(size: size_t) -> *const c_void;
pub fn mi_malloc(size: size_t) -> *const c_void;
pub fn mi_realloc(p: *const c_void, size: size_t) -> *const c_void;
pub fn mi_zalloc_aligned(size: size_t, alignment: size_t) -> *const c_void;
pub fn mi_malloc_aligned(size: size_t, alignment: size_t) -> *const c_void;
pub fn mi_realloc_aligned(p: *const c_void, size: size_t, alignment: size_t) -> *const c_void;
pub fn mi_zalloc(size: usize) -> *const c_void;
pub fn mi_malloc(size: usize) -> *const c_void;
pub fn mi_realloc(p: *const c_void, size: usize) -> *const c_void;
pub fn mi_zalloc_aligned(size: usize, alignment: usize) -> *const c_void;
pub fn mi_malloc_aligned(size: usize, alignment: usize) -> *const c_void;
pub fn mi_realloc_aligned(p: *const c_void, size: usize, alignment: usize) -> *const c_void;
pub fn mi_free(p: *const c_void) -> c_void;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern crate libmimalloc_sys as ffi;

use core::alloc::{GlobalAlloc, Layout};
use ffi::*;
use libc::c_void;
use core::ffi::c_void;

// Copied from https://github.com/rust-lang/rust/blob/master/src/libstd/sys_common/alloc.rs
#[cfg(all(any(
Expand Down