Skip to content

Commit 299d1be

Browse files
authored
Merge pull request #2 from djmcgill/master
Update to remove Opaque type and fix on nightly
2 parents 7d5d6c9 + 38243c0 commit 299d1be

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(allocator_api)]
22

3-
use std::alloc::{GlobalAlloc, Layout, Opaque};
3+
use std::alloc::{GlobalAlloc, Layout};
44

55
use std::os::raw::c_void;
66

@@ -15,11 +15,11 @@ extern "C" {
1515
pub struct TCMalloc;
1616

1717
unsafe impl GlobalAlloc for TCMalloc {
18-
unsafe fn alloc(&self, layout: Layout) -> *mut Opaque {
19-
tc_memalign(layout.align(), layout.size()) as *mut Opaque
18+
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
19+
tc_memalign(layout.align(), layout.size()) as *mut u8
2020
}
2121

22-
unsafe fn dealloc(&self, ptr: *mut Opaque, _layout: Layout) {
22+
unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) {
2323
tc_free(ptr as *mut c_void);
2424
// tc_free_sized(ptr as *mut c_void, layout.size());
2525
}

0 commit comments

Comments
 (0)