Skip to content

Commit

Permalink
Add is_64_bit to RawInstance and Module
Browse files Browse the repository at this point in the history
  • Loading branch information
koute committed Nov 14, 2024
1 parent 5cc35a9 commit 7f3841f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/polkavm/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,11 @@ impl Module {
Ok(Module(Some(module)))
}

/// Returns whether the module is 64-bit.
pub fn is_64_bit(&self) -> bool {
self.state().blob.is_64_bit()
}

/// Fetches a cached module for the given `blob`.
#[cfg_attr(not(feature = "module-cache"), allow(unused_variables))]
pub fn from_cache(engine: &Engine, config: &ModuleConfig, blob: &ProgramBlob) -> Option<Self> {
Expand Down Expand Up @@ -902,6 +907,11 @@ impl RawInstance {
&self.module
}

/// Returns whether we're running a 64-bit program.
pub fn is_64_bit(&self) -> bool {
self.module.is_64_bit()
}

/// Starts or resumes the execution.
pub fn run(&mut self) -> Result<InterruptKind, Error> {
if self.next_program_counter().is_none() {
Expand Down

0 comments on commit 7f3841f

Please sign in to comment.