mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 13:41:32 +00:00
Add the internals
field and necessary structures for metering.
This commit is contained in:
@ -15,7 +15,20 @@ use crate::{
|
||||
},
|
||||
vm,
|
||||
};
|
||||
use std::slice;
|
||||
use std::{
|
||||
slice,
|
||||
fmt::Debug,
|
||||
};
|
||||
|
||||
pub const INTERNALS_SIZE: usize = 256;
|
||||
|
||||
pub(crate) struct Internals(pub(crate) [u64; INTERNALS_SIZE]);
|
||||
|
||||
impl Debug for Internals {
|
||||
fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
write!(formatter, "Internals({:?})", &self.0[..])
|
||||
}
|
||||
}
|
||||
|
||||
/// The `LocalBacking` "owns" the memory used by all the local resources of an Instance.
|
||||
/// That is, local memories, tables, and globals (as well as some additional
|
||||
@ -40,6 +53,8 @@ pub struct LocalBacking {
|
||||
/// as well) are subject to change.
|
||||
pub(crate) dynamic_sigindices: BoxedMap<SigIndex, vm::SigId>,
|
||||
pub(crate) local_functions: BoxedMap<LocalFuncIndex, *const vm::Func>,
|
||||
|
||||
pub(crate) internals: Internals,
|
||||
}
|
||||
|
||||
impl LocalBacking {
|
||||
@ -66,6 +81,8 @@ impl LocalBacking {
|
||||
|
||||
dynamic_sigindices,
|
||||
local_functions,
|
||||
|
||||
internals: Internals([0; 256]),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user