feat: comment
This commit is contained in:
@@ -52,10 +52,16 @@ impl<'vm> VM<'vm> {
|
||||
}
|
||||
|
||||
pub fn get_thunk(&self, idx: usize) -> &'vm Thunk<'vm> {
|
||||
// SAFETY: The `idx` is within bounds as `thunks` is initialized with `prog.thunks`
|
||||
// and `idx` is expected to be a valid index into this collection.
|
||||
// The lifetime of the returned reference is tied to `&self`.
|
||||
unsafe { &*(&self.thunks[idx] as *const _) }
|
||||
}
|
||||
|
||||
pub fn get_func(&self, idx: usize) -> &'vm Func<'vm> {
|
||||
// SAFETY: The `idx` is within bounds as `funcs` is initialized with `prog.funcs`
|
||||
// and `idx` is expected to be a valid index into this collection.
|
||||
// The lifetime of the returned reference is tied to `&self`.
|
||||
unsafe { &*(&self.funcs[idx] as *const _) }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user