Skip to content

Commit b789c6f

Browse files
committed
Make ResourceArc::as_c_arg() public
resolves #734
1 parent 4314772 commit b789c6f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

rustler/src/resource/arc.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ where
104104
unsafe { Term::new(env, enif_make_resource(env.as_c_arg(), self.raw)) }
105105
}
106106

107-
fn as_c_arg(&mut self) -> *const c_void {
107+
/// Return a pointer to the memory area allocated by the erlang VM.
108+
///
109+
/// Note that this pointer does not necessarily point to the contained type but is commonly used
110+
/// as an object identifier for an allocated resource when interacting with low-level VM functions
111+
/// like [`enif_select()`](crate::sys::enif_select).
112+
pub fn as_c_arg(&mut self) -> *const c_void {
108113
self.raw
109114
}
110115

0 commit comments

Comments
 (0)