Skip to content

Commit

Permalink
added lifetimes to allocatable
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeryAntopol committed Nov 10, 2023
1 parent dc806fd commit 71a44a3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions crates/it-lilo/src/lowerer/memory_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ impl<'i, A: Allocatable<MV, Store>, MV: MemoryView<Store>, Store: it_memory_trai
Ok(writer)
}

pub async fn write_bytes(
pub async fn write_bytes<'ctx1, 'ctx2: 'ctx1>(
&mut self,
store: &mut <Store as it_memory_traits::Store>::ActualStore<'_>,
store: &'ctx1 mut <Store as it_memory_traits::Store>::ActualStore<'ctx2>,
bytes: &[u8],
) -> LoResult<u32> {
let byte_type_tag = type_tag_form_itype(&crate::IType::U8);
Expand All @@ -58,9 +58,9 @@ impl<'i, A: Allocatable<MV, Store>, MV: MemoryView<Store>, Store: it_memory_trai
Ok(seq_writer.start_offset())
}

pub async fn sequential_writer(
pub async fn sequential_writer<'ctx1, 'ctx2: 'ctx1>(
&mut self,
store: &mut <Store as it_memory_traits::Store>::ActualStore<'_>,
store: &'ctx1 mut <Store as it_memory_traits::Store>::ActualStore<'ctx2>,
size: u32,
type_tag: u32,
) -> LoResult<SequentialWriter> {
Expand Down
4 changes: 2 additions & 2 deletions crates/it-lilo/src/traits/allocatable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ pub const DEFAULT_MEMORY_INDEX: usize = 0;

#[async_trait::async_trait]
pub trait Allocatable<MV: MemoryView<Store>, Store: it_memory_traits::Store>: Send {
async fn allocate(
async fn allocate<'ctx1, 'ctx2: 'ctx1>(
&mut self,
store: &mut <Store as it_memory_traits::Store>::ActualStore<'_>,
store: &'ctx1 mut <Store as it_memory_traits::Store>::ActualStore<'ctx2>,
size: u32,
type_tag: u32,
) -> Result<(u32, MV), AllocatableError>;
Expand Down
4 changes: 2 additions & 2 deletions wasmer-it/src/interpreter/instructions/lilo/lo_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ where
Instance: wasm::structures::Instance<Export, LocalImport, Memory, MemoryView, Store>,
Store: wasm::structures::Store,
{
async fn allocate(
async fn allocate<'ctx1, 'ctx2: 'ctx1>(
&mut self,
store: &mut <Store as wasm::structures::Store>::ActualStore<'_>,
store: &'ctx1 mut <Store as wasm::structures::Store>::ActualStore<'ctx2>,
size: u32,
type_tag: u32,
) -> Result<(u32, MemoryView), AllocatableError> {
Expand Down

0 comments on commit 71a44a3

Please sign in to comment.