File tree Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 7272 - name : " Run cargo test without features on stable"
7373 run : cargo +stable test --no-default-features
7474
75+ - name : " Build with `use_spin` feature on stable"
76+ run : cargo +stable build --no-default-features --features use_spin
77+
78+ - name : " Run cargo test with `use_spin` feature on stable"
79+ run : cargo +stable test --no-default-features --features use_spin
80+
7581 test-unstable :
7682 name : " Test unstable features"
7783
Original file line number Diff line number Diff line change @@ -15,11 +15,10 @@ homepage = "http://os.phil-opp.com/kernel-heap.html#a-better-allocator"
1515default = [" use_spin" , " const_mut_refs" ]
1616use_spin = [" spinning_top" ]
1717alloc_ref = []
18- const_mut_refs = []
18+ const_mut_refs = [" spinning_top/nightly " ]
1919
2020[dependencies .spinning_top ]
2121version = " 0.1.0"
22- features = [" nightly" ]
2322optional = true
2423
2524[package .metadata .release ]
Original file line number Diff line number Diff line change 11# Unreleased
22
3+ - Don't require nightly for ` use_spin ` feature ([ #46 ] ( https://github.com/phil-opp/linked-list-allocator/pull/46 ) )
4+
35# 0.8.8 – 2020-12-16
46
57- Do not require alloc crate ([ #44 ] ( https://github.com/phil-opp/linked-list-allocator/pull/44 ) )
Original file line number Diff line number Diff line change @@ -194,10 +194,17 @@ pub struct LockedHeap(Spinlock<Heap>);
194194#[ cfg( feature = "use_spin" ) ]
195195impl LockedHeap {
196196 /// Creates an empty heap. All allocate calls will return `None`.
197+ #[ cfg( feature = "const_mut_refs" ) ]
197198 pub const fn empty ( ) -> LockedHeap {
198199 LockedHeap ( Spinlock :: new ( Heap :: empty ( ) ) )
199200 }
200201
202+ /// Creates an empty heap. All allocate calls will return `None`.
203+ #[ cfg( not( feature = "const_mut_refs" ) ) ]
204+ pub fn empty ( ) -> LockedHeap {
205+ LockedHeap ( Spinlock :: new ( Heap :: empty ( ) ) )
206+ }
207+
201208 /// Creates a new heap with the given `bottom` and `size`. The bottom address must be valid
202209 /// and the memory in the `[heap_bottom, heap_bottom + heap_size)` range must not be used for
203210 /// anything else. This function is unsafe because it can cause undefined behavior if the
You can’t perform that action at this time.
0 commit comments