10000 [v0.5] New design with two wrapper types: `VolatilePtr` and `VolatileRef` by phil-opp · Pull Request #29 · rust-osdev/volatile · GitHub
[go: up one dir, main page]

Skip to content

[v0.5] New design with two wrapper types: VolatilePtr and VolatileRef #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 71 commits into from
Jun 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
a7ae579
New design based on `UnsafeCell`
phil-opp May 18, 2021
946b37b
Use `*mut T` instead of `&UnsafeCell<T>` since the latter is derefere…
phil-opp May 21, 2021
682dd70
Add access types for allowing only unsafe reads and/or writes
phil-opp May 21, 2021
0699e4e
Remove stabilized const_generics feature
phil-opp Jun 13, 2021
2ece021
Redesign access types and adjust (doc)tests
phil-opp Jun 13, 2021
534ec6e
Use `NonNull` instead of `*mut T`
phil-opp Jun 13, 2021
c3d6b9a
Add lifetime parameter and rename to `VolatilePtr`
phil-opp Jun 14, 2021
9f7b015
Fix: do bounds checking in `index` and `index_mut`
phil-opp Jun 14, 2021
b525f38
Add `const` index functions under a new `very_unstable` feature
phil-opp Jun 14, 2021
4accd51
add `VolatilePtr::as_slice_mut`
Freax13 Jun 4, 2022
a9e8509
add `VolatilePtr::iter` & `VolatilePtr::iter_mut`
Freax13 Jun 4, 2022
167adec
add `VolatilePtr::is_empty`
Freax13 Jun 4, 2022
aa93fb9
add missing access where bounds
Freax13 Jun 4, 2022
554c806
reject mapping to unaligned fields
Freax13 Jun 4, 2022
ff0ee4f
WIP: owned with borrow
Freax13 Jun 15, 2022
cd57be9
fix UAF in doctest
Freax13 Jul 3, 2022
73cd996
Re-add the wrapper type used in `v0.3` as `VolatileCell`
phil-opp Jan 17, 2023
6ab1af4
Move pointer-based implementation to submodule
phil-opp Jan 17, 2023
d69da5c
Merge branch 'unsafe-cell-but-owned' into next
phil-opp Jan 17, 2023
111db0a
Adjust stable functions of `VolatilePtr` to simplified access types
phil-opp Jan 17, 2023
8385818
Add methods for borrowing a `VolatileCell` as `VolatilePtr`
phil-opp Jan 17, 2023
2fbc956
Use new pointer borrow methods for implementing read/write functions …
phil-opp Jan 17, 2023
cf4c57c
Wrap `VolatileCell::value` in `UnsafeCell` to prevent aliasing issues
phil-opp Jan 17, 2023
1d2d3bf
Reexport `VolatileCell` and `VolatilePtr`
phil-opp Jan 17, 2023
c323667
Improve generated docs
phil-opp Jan 17, 2023
5da07e7
Fix: Using `borrow` on a `WriteOnly` pointer should result in no access
phil-opp Jan 17, 2023
06404ff
Move trait bounds to methods (instead of impl blocks)
phil-opp Jan 17, 2023
60b2db2
Remove unneeded unsafe
phil-opp Jan 17, 2023
9b03f61
Remove unneeded extern crate statements in doc tests
phil-opp Jan 17, 2023
f5602e7
Move `VolatilePtr` trait bounds to methods (instead of impl blocks)
phil-opp Jan 17, 2023
2be8bbd
Reorder impl blocks (unstable features last)
phil-opp Jan 17, 2023
70fa6ca
Use 2021 edition
phil-opp Jan 17, 2023
f3795cc
Remove unused import
phil-opp Jan 17, 2023
f21ef3f
Fix doctests
phil-opp Jan 17, 2023
cb0fc46
Add a `new_read_only` convenience function
phil-opp Jan 17, 2023
4a8c18b
Create an internal `new_generic` constructor
phil-opp Jan 17, 2023
d0a237a
Update unstable methods and their doc tests
phil-opp Jan 17, 2023
bbb23f4
Remove stabilized features
phil-opp Jan 17, 2023
a143e0b
Update `very_unstable` to work with new access types and latest nightly
phil-opp Jan 17, 2023
b7cb879
Add an alternative `VolatilePtrCopy` variant that implement Copy
phil-opp Jan 17, 2023
99e3329
Implement Send/Sync for `VolatilePtr`
phil-opp Jan 17, 2023
927b061
Merge pull request #28 from Freax13/unsafe-cell-but-owned
phil-opp Jan 17, 2023
24326c3
Merge branch 'unsafe-cell' into next
phil-opp Jan 17, 2023
c948890
Refactor macros and unstable functions into submodules
phil-opp Jan 17, 2023
01cbbdc
Adjust and enable `VolatilePtr` tests
phil-opp Jan 17, 2023
e1578af
Implement test suite for `VolatilePtrCopy` too
phil-opp Jan 17, 2023
8201fa5
Rename `VolatilePtr` to `VolatilePtrSend`
phil-opp Jan 17, 2023
8e71845
Remove the `VolatileCell` type for now
phil-opp Jan 17, 2023
dd5cfaf
Provide a default `Access` implementation for `Readable`
phil-opp Jan 20, 2023
42fe49d
Add conversion methods from `VolatilePtrSend` to `VolatilePtrCopy`
phil-opp Jan 20, 2023
6fd4ea1
Rename non-copy pointer type to `VolatileRef`
phil-opp Apr 28, 2023
401d903
Rename copyable pointer type to `VolatilePtr`
phil-opp Apr 28, 2023
1e265b1
Remove most methods from `VolatileRef` to avoid duplication
phil-opp Apr 28, 2023
34ecfdc
Various improvements to `VolatilePtr` type
phil-opp Apr 28, 2023
ad02642
Make `VolatileRef` copyable if it's read-only
phil-opp Apr 28, 2023
519895e
Improve docs
phil-opp Apr 28, 2023
739e5b2
Fix unstable module
phil-opp Apr 28, 2023
e539980
Explain why there is no `VolatileCell` type
phil-opp Jun 24, 2023
bacaa77
Update crate description in README
phil-opp Jun 24, 2023
50cbec6
Update crate metadata
phil-opp Jun 24, 2023
759e312
Delete old `ref.rs` file
phil-opp Jun 24, 2023
24db296
Remove `*_mut` variants of pointer methods
phil-opp Jun 24, 2023
16dcea3
Print pointer instead of values in `Debug` impl
phil-opp Jun 24, 2023
f220854
Document the constructor functions
phil-opp Jun 24, 2023
00fc090
Document the conversion functions and add a `into_ptr` method
phil-opp Jun 24, 2023
c82b35d
Remove uneeded feature gates
phil-opp Jun 24, 2023
2108aad
Document remaining methods
phil-opp Jun 24, 2023
6410c4e
Silence two clippy warnings
phil-opp Jun 24, 2023
020ffbe
Update cargo-release configuration to latest version
phil-opp Jun 24, 2023
0d51b27
Write changelog entry for 0.5 release
phil-opp Jun 24, 2023
225ae4c
Also test `very_unstable` feature on CI
phil-opp Jun 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unneeded unsafe
  • Loading branch information
phil-opp committed Jan 17, 2023
commit 60b2db2d04d0632b22c8780c47f34a1fcf991c9c
2 changes: 1 addition & 1 deletion src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ mod tests {
fn test_write() {
let mut volatile = VolatileCell::new(42);
volatile.write(50);
assert_eq!(unsafe { *volatile.value.get_mut() }, 50);
assert_eq!(*volatile.value.get_mut(), 50);
}

#[test]
Expand Down
0