mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
minor cleanup
This commit is contained in:
parent
8305affe25
commit
ad7be994ce
1 changed files with 2 additions and 1 deletions
|
@ -20,6 +20,7 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
const REFCOUNT_ONE: usize = isize::MIN as usize;
|
const REFCOUNT_ONE: usize = isize::MIN as usize;
|
||||||
|
const REFCOUNT_CONSTANT: usize = 0;
|
||||||
|
|
||||||
/// ThreadSafeRefcountedResourceHeap is a threadsafe version of the refcounted heap that can avoid a wrapping Mutex and RefCell.
|
/// ThreadSafeRefcountedResourceHeap is a threadsafe version of the refcounted heap that can avoid a wrapping Mutex and RefCell.
|
||||||
/// This is very important for dealloc performance.
|
/// This is very important for dealloc performance.
|
||||||
|
@ -130,7 +131,7 @@ impl<T> RefcountedResourceHeap<T> {
|
||||||
let offset = i * Heap::<Refcounted<T>>::node_size();
|
let offset = i * Heap::<Refcounted<T>>::node_size();
|
||||||
let elem_ptr = unsafe { self.0.data.as_mut_ptr().add(offset) };
|
let elem_ptr = unsafe { self.0.data.as_mut_ptr().add(offset) };
|
||||||
let rc_ptr = elem_ptr as *mut usize;
|
let rc_ptr = elem_ptr as *mut usize;
|
||||||
unsafe { *rc_ptr = 0 };
|
unsafe { *rc_ptr = REFCOUNT_CONSTANT };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue