diff --git a/core/io/generic.rs b/core/io/generic.rs index 3373d1243..66f428971 100644 --- a/core/io/generic.rs +++ b/core/io/generic.rs @@ -38,10 +38,6 @@ impl IO for GenericIO { fn run_once(&self) -> Result<()> { Ok(()) } - - fn get_memory_io(&self) -> Arc { - Arc::new(MemoryIO::new()) - } } impl Clock for GenericIO { diff --git a/core/io/io_uring.rs b/core/io/io_uring.rs index a31c2d025..4adf30ac9 100644 --- a/core/io/io_uring.rs +++ b/core/io/io_uring.rs @@ -3,7 +3,7 @@ use super::{common, Completion, CompletionInner, File, OpenFlags, IO}; use crate::io::clock::{Clock, Instant}; use crate::storage::wal::CKPT_BATCH_PAGES; -use crate::{turso_assert, LimboError, MemoryIO, Result}; +use crate::{turso_assert, LimboError, Result}; use rustix::fs::{self, FlockOperation, OFlags}; use std::ptr::NonNull; use std::{ @@ -528,10 +528,6 @@ impl IO for UringIO { } } - fn get_memory_io(&self) -> Arc { - Arc::new(MemoryIO::new()) - } - fn register_fixed_buffer(&self, ptr: std::ptr::NonNull, len: usize) -> Result { turso_assert!( len % 512 == 0, diff --git a/core/io/memory.rs b/core/io/memory.rs index da95c008f..180308c0f 100644 --- a/core/io/memory.rs +++ b/core/io/memory.rs @@ -67,10 +67,6 @@ impl IO for MemoryIO { // nop Ok(()) } - - fn get_memory_io(&self) -> Arc { - Arc::new(MemoryIO::new()) - } } pub struct MemoryFile { diff --git a/core/io/mod.rs b/core/io/mod.rs index ae8c97611..3b153ca36 100644 --- a/core/io/mod.rs +++ b/core/io/mod.rs @@ -99,7 +99,9 @@ pub trait IO: Clock + Send + Sync { i64::from_ne_bytes(buf) } - fn get_memory_io(&self) -> Arc; + fn get_memory_io(&self) -> Arc { + Arc::new(MemoryIO::new()) + } fn register_fixed_buffer(&self, _ptr: NonNull, _len: usize) -> Result { Err(crate::LimboError::InternalError( diff --git a/core/io/unix.rs b/core/io/unix.rs index db308c62b..b228ba68a 100644 --- a/core/io/unix.rs +++ b/core/io/unix.rs @@ -1,4 +1,4 @@ -use super::{Completion, File, MemoryIO, OpenFlags, IO}; +use super::{Completion, File, OpenFlags, IO}; use crate::error::LimboError; use crate::io::clock::{Clock, Instant}; use crate::io::common; @@ -398,10 +398,6 @@ impl IO for UnixIO { Ok(()) } - - fn get_memory_io(&self) -> Arc { - Arc::new(MemoryIO::new()) - } } enum CompletionCallback { diff --git a/core/io/vfs.rs b/core/io/vfs.rs index be0b919fb..89c8040cb 100644 --- a/core/io/vfs.rs +++ b/core/io/vfs.rs @@ -1,4 +1,4 @@ -use super::{Buffer, Completion, File, MemoryIO, OpenFlags, IO}; +use super::{Buffer, Completion, File, OpenFlags, IO}; use crate::ext::VfsMod; use crate::io::clock::{Clock, Instant}; use crate::io::CompletionInner; @@ -51,10 +51,6 @@ impl IO for VfsMod { let vfs = unsafe { &*self.ctx }; unsafe { (vfs.gen_random_number)() } } - - fn get_memory_io(&self) -> Arc { - Arc::new(MemoryIO::new()) - } } impl VfsMod { diff --git a/core/io/windows.rs b/core/io/windows.rs index 769cd1289..dcc42474f 100644 --- a/core/io/windows.rs +++ b/core/io/windows.rs @@ -35,11 +35,6 @@ impl IO for WindowsIO { fn run_once(&self) -> Result<()> { Ok(()) } - - #[instrument(skip_all, level = Level::TRACE)] - fn get_memory_io(&self) -> Arc { - Arc::new(MemoryIO::new()) - } } impl Clock for WindowsIO { diff --git a/simulator/runner/io.rs b/simulator/runner/io.rs index ca585500a..ae50106b7 100644 --- a/simulator/runner/io.rs +++ b/simulator/runner/io.rs @@ -5,7 +5,7 @@ use std::{ use rand::{RngCore, SeedableRng}; use rand_chacha::ChaCha8Rng; -use turso_core::{Clock, Instant, MemoryIO, OpenFlags, PlatformIO, Result, IO}; +use turso_core::{Clock, Instant, OpenFlags, PlatformIO, Result, IO}; use crate::{ model::FAULT_ERROR_MSG, @@ -128,8 +128,4 @@ impl IO for SimulatorIO { fn generate_random_number(&self) -> i64 { self.rng.borrow_mut().next_u64() as i64 } - - fn get_memory_io(&self) -> Arc { - Arc::new(MemoryIO::new()) - } }