kubkon opened PR #1395 from mut-cleanup
to master
:
Until now, several syscalls including
fd_pwrite
etc. were relying on mutating&mut Entry
by mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::File
in Rust's libstd are also implemented for&std::fs::File
. In part, this will prepare us to handleEntry
s behind anRc
andRefCell
combo.While here, I've also modified
OsHandle
in BSD to includeRefCell<Option<Dir>>
rather thanOption<Mutex<Dir>>
as was until now. WhileRefCell
could easily be replaced withRefCell
, since going multithreading will require a lot of (probably even) conceptual changes towasi-common
, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swapped mutability for interior mutability in places.
kubkon requested alexcrichton and iximeow for a review on PR #1395.
kubkon requested alexcrichton and iximeow for a review on PR #1395.
kubkon edited PR #1395 from mut-cleanup
to master
:
Until now, several syscalls including
fd_pwrite
etc. were relying on mutating&mut Entry
by mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::File
in Rust's libstd are also implemented for&std::fs::File
. In part, this will prepare us to handleEntry
s behind anRc
andRefCell
combo.While here, I've also modified
OsHandle
in BSD to includeRefCell<Option<Dir>>
rather thanOption<Mutex<Dir>>
as was until now. WhileRefCell
could easily be replaced withMutex
, since going multithreading will require a lot of (probably even) conceptual changes towasi-common
, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swapped mutability for interior mutability in places.
kubkon edited PR #1395 from mut-cleanup
to master
:
Until now, several syscalls including
fd_pwrite
etc. were relying on mutating&mut Entry
by mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::File
in Rust's libstd are also implemented for&std::fs::File
. In part, this will prepare us to handleEntry
s behind anRc
andRefCell
combo.While here, I've also modified
OsHandle
in BSD to includeRefCell<Option<Dir>>
rather thanOption<Mutex<Dir>>
as was until now. WhileRefCell
could easily be replaced withMutex
, since going multithreading will require a lot of conceptual changes towasi-common
, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swapped mutability for interior mutability in places.
kubkon edited PR #1395 from mut-cleanup
to master
:
Until now, several syscalls including
fd_pwrite
etc. were relying on mutating&mut Entry
by mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::File
in Rust's libstd are also implemented for&std::fs::File
. In part, this will prepare us to handleEntry
s behind anRc
andRefCell
combo.While here, I've also modified
OsHandle
in BSD to includeRefCell<Option<Dir>>
rather thanOption<Mutex<Dir>>
as was until now. WhileRefCell
could easily be replaced withMutex
, since going multithreading will require a lot of conceptual changes towasi-common
, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swaps mutability for interior mutability in places.
kubkon edited PR #1395 from mut-cleanup
to master
:
Until now, several syscalls including
fd_pwrite
etc. were relying on mutating&mut Entry
by mutating its inner file handle. This is unnecessary in almost all cases since all methods mutatingstd::fs::File
in Rust's libstd are also implemented for&std::fs::File
. In part, this will prepare us to handleEntry
s behind anRc
andRefCell
combo.While here, I've also modified
OsHandle
in BSD to includeRefCell<Option<Dir>>
rather thanOption<Mutex<Dir>>
as was until now. WhileRefCell
could easily be replaced withMutex
, since going multithreading will require a lot of conceptual changes towasi-common
, I thought it'd be best not to mix single- with multithreading contexts and swap all places at once when it comes to it. If y'all feel this is not the right approach, lemme know!I've also had to make some modifications to virtual FS which mainly swaps mutability for interior mutability in a handful of places.
Last updated: Dec 23 2024 at 12:05 UTC