mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-30 22:44:21 +01:00
Merge 'Remove some unnecessary unsafe impls' from Pedro Muniz
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #3236
This commit is contained in:
@@ -34,7 +34,6 @@ impl<T> DerefMut for SpinLockGuard<'_, T> {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: Send> Send for SpinLock<T> {}
|
||||
unsafe impl<T> Sync for SpinLock<T> {}
|
||||
|
||||
impl<T> SpinLock<T> {
|
||||
|
||||
@@ -12,7 +12,6 @@ use tracing::debug;
|
||||
pub struct MemoryIO {
|
||||
files: Arc<Mutex<HashMap<String, Arc<MemoryFile>>>>,
|
||||
}
|
||||
unsafe impl Send for MemoryIO {}
|
||||
|
||||
// TODO: page size flag
|
||||
const PAGE_SIZE: usize = 4096;
|
||||
@@ -76,7 +75,7 @@ pub struct MemoryFile {
|
||||
pages: UnsafeCell<BTreeMap<usize, MemPage>>,
|
||||
size: Cell<u64>,
|
||||
}
|
||||
unsafe impl Send for MemoryFile {}
|
||||
|
||||
unsafe impl Sync for MemoryFile {}
|
||||
|
||||
impl File for MemoryFile {
|
||||
|
||||
@@ -17,9 +17,6 @@ use tracing::{instrument, trace, Level};
|
||||
|
||||
pub struct UnixIO {}
|
||||
|
||||
unsafe impl Send for UnixIO {}
|
||||
unsafe impl Sync for UnixIO {}
|
||||
|
||||
impl UnixIO {
|
||||
#[cfg(feature = "fs")]
|
||||
pub fn new() -> Result<Self> {
|
||||
@@ -128,8 +125,6 @@ impl IO for UnixIO {
|
||||
pub struct UnixFile {
|
||||
file: Arc<Mutex<std::fs::File>>,
|
||||
}
|
||||
unsafe impl Send for UnixFile {}
|
||||
unsafe impl Sync for UnixFile {}
|
||||
|
||||
impl File for UnixFile {
|
||||
fn lock_file(&self, exclusive: bool) -> Result<()> {
|
||||
|
||||
@@ -88,11 +88,6 @@ pub struct DatabaseFile {
|
||||
file: Arc<dyn crate::io::File>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "fs")]
|
||||
unsafe impl Send for DatabaseFile {}
|
||||
#[cfg(feature = "fs")]
|
||||
unsafe impl Sync for DatabaseFile {}
|
||||
|
||||
#[cfg(feature = "fs")]
|
||||
impl DatabaseStorage for DatabaseFile {
|
||||
#[instrument(skip_all, level = Level::DEBUG)]
|
||||
|
||||
Reference in New Issue
Block a user