Skip to content

Commit 8c71cd1

Browse files
authored
fix: do not require alloc crate (#44)
Using `core::alloc` instead of `alloc::alloc` removes the need to include `alloc` in this library. This enables users of this crate to use `Heap` without `alloc` in `no_std`.
1 parent 4a858c7 commit 8c71cd1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/hole.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use alloc::alloc::Layout;
1+
use core::alloc::Layout;
22
use core::mem::{align_of, size_of};
33
use core::ptr::NonNull;
44

src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ extern crate std;
1212
#[cfg(feature = "use_spin")]
1313
extern crate spinning_top;
1414

15-
extern crate alloc;
16-
17-
use alloc::alloc::Layout;
18-
#[cfg(feature = "alloc_ref")]
19-
use alloc::alloc::{AllocError, Allocator};
2015
#[cfg(feature = "use_spin")]
2116
use core::alloc::GlobalAlloc;
17+
use core::alloc::Layout;
18+
#[cfg(feature = "alloc_ref")]
19+
use core::alloc::{AllocError, Allocator};
2220
use core::mem;
2321
#[cfg(feature = "use_spin")]
2422
use core::ops::Deref;

0 commit comments

Comments
 (0)