File tree 4 files changed +16
-2
lines changed
4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 72
72
- name : " Run cargo test without features on stable"
73
73
run : cargo +stable test --no-default-features
74
74
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
+
75
81
test-unstable :
76
82
name : " Test unstable features"
77
83
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"
15
15
default = [" use_spin" , " const_mut_refs" ]
16
16
use_spin = [" spinning_top" ]
17
17
alloc_ref = []
18
- const_mut_refs = []
18
+ const_mut_refs = [" spinning_top/nightly " ]
19
19
20
20
[dependencies .spinning_top ]
21
21
version = " 0.1.0"
22
- features = [" nightly" ]
23
22
optional = true
24
23
25
24
[package .metadata .release ]
Original file line number Diff line number Diff line change 1
1
# Unreleased
2
2
3
+ - Don't require nightly for ` use_spin ` feature ([ #46 ] ( https://github.com/phil-opp/linked-list-allocator/pull/46 ) )
4
+
3
5
# 0.8.8 – 2020-12-16
4
6
5
7
- 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>);
194
194
#[ cfg( feature = "use_spin" ) ]
195
195
impl LockedHeap {
196
196
/// Creates an empty heap. All allocate calls will return `None`.
197
+ #[ cfg( feature = "const_mut_refs" ) ]
197
198
pub const fn empty ( ) -> LockedHeap {
198
199
LockedHeap ( Spinlock :: new ( Heap :: empty ( ) ) )
199
200
}
200
201
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
+
201
208
/// Creates a new heap with the given `bottom` and `size`. The bottom address must be valid
202
209
/// and the memory in the `[heap_bottom, heap_bottom + heap_size)` range must not be used for
203
210
/// 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