Skip to content

Commit a6c956f

Browse files
committed
Removed libc dependency
1 parent ad8af1a commit a6c956f

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ members = ["libmimalloc-sys" ]
2020
travis-ci = { repository = "purpleprotocol/mimalloc_rust" }
2121

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

2625
[features]

libmimalloc-sys/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ description = "Sys crate wrapping the mimalloc allocator"
1010
license = "MIT"
1111

1212
[dependencies]
13-
libc = "0.2"
1413

1514
[build-dependencies]
1615
cmake = "0.1"

libmimalloc-sys/src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Copyright 2019 Octavian Oncescu
22

3-
use libc::{c_void, size_t};
3+
use core::ffi::c_void;
44

55
extern "C" {
6-
pub fn mi_zalloc(size: size_t) -> *const c_void;
7-
pub fn mi_malloc(size: size_t) -> *const c_void;
8-
pub fn mi_realloc(p: *const c_void, size: size_t) -> *const c_void;
9-
pub fn mi_zalloc_aligned(size: size_t, alignment: size_t) -> *const c_void;
10-
pub fn mi_malloc_aligned(size: size_t, alignment: size_t) -> *const c_void;
11-
pub fn mi_realloc_aligned(p: *const c_void, size: size_t, alignment: size_t) -> *const c_void;
6+
pub fn mi_zalloc(size: usize) -> *const c_void;
7+
pub fn mi_malloc(size: usize) -> *const c_void;
8+
pub fn mi_realloc(p: *const c_void, size: usize) -> *const c_void;
9+
pub fn mi_zalloc_aligned(size: usize, alignment: usize) -> *const c_void;
10+
pub fn mi_malloc_aligned(size: usize, alignment: usize) -> *const c_void;
11+
pub fn mi_realloc_aligned(p: *const c_void, size: usize, alignment: usize) -> *const c_void;
1212
pub fn mi_free(p: *const c_void) -> c_void;
1313
}
1414

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern crate libmimalloc_sys as ffi;
2727

2828
use core::alloc::{GlobalAlloc, Layout};
2929
use ffi::*;
30-
use libc::c_void;
30+
use core::ffi::c_void;
3131

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

0 commit comments

Comments
 (0)