Skip to content

Commit

Permalink
add FfiCtx::new_empty_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
oxfeeefeee committed Sep 4, 2023
1 parent 274fd65 commit e49764c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vm/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ impl<'a> FfiCtx<'a> {
))
}

#[inline]
pub fn new_empty_interface(&self, underlying: GosValue, meta: Meta) -> GosValue {
GosValue::new_interface(InterfaceObj::with_value(underlying, Some((meta, vec![]))))
}

#[inline]
pub fn deref_pointer(&self, ptr: &GosValue) -> RuntimeResult<GosValue> {
ptr.as_non_nil_pointer()?
Expand Down

0 comments on commit e49764c

Please sign in to comment.