forked from M-Labs/zynq-rs
Compare commits
2 Commits
a73df780d0
...
a116142f63
Author | SHA1 | Date |
---|---|---|
pca006132 | a116142f63 | |
pca006132 | 157439bc88 |
|
@ -12,7 +12,7 @@ pub struct Semaphore {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Semaphore {
|
impl Semaphore {
|
||||||
pub fn new(value: i32, max: i32) -> Self {
|
pub const fn new(value: i32, max: i32) -> Self {
|
||||||
Semaphore { value: AtomicI32::new(value), max}
|
Semaphore { value: AtomicI32::new(value), max}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,10 @@ unsafe impl GlobalAlloc for CortexA9Alloc {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
||||||
if cfg!(not(feature = "alloc_core")) || MPIDR.read().cpu_id() == 0 {
|
if cfg!(not(feature = "alloc_core"))
|
||||||
|
|| ((&__heap0_start as *const usize as usize <= ptr as usize)
|
||||||
|
&& ((ptr as usize) < &__heap0_end as *const usize as usize))
|
||||||
|
{
|
||||||
&self.0
|
&self.0
|
||||||
} else {
|
} else {
|
||||||
&self.1
|
&self.1
|
||||||
|
|
Loading…
Reference in New Issue