mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
add Safety section to roc_box as_refcount_ptr()
This commit is contained in:
parent
badba1d9c0
commit
89ce3d61d8
1 changed files with 4 additions and 0 deletions
|
@ -76,6 +76,10 @@ where
|
|||
|
||||
/// The raw pointer to a roc box, including the leading refcount
|
||||
/// Intended for use by platforms in roc_dealloc
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// Returns a raw pointer to the roc box
|
||||
pub unsafe fn as_refcount_ptr(&self) -> *mut c_void {
|
||||
let alignment = Self::alloc_alignment();
|
||||
let with_offset = unsafe { self.contents.as_ptr().cast::<u8>().sub(alignment) };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue