-
Notifications
You must be signed in to change notification settings - Fork 132
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
Mapper #88
Comments
The We could of course add an |
Could we cache whether the frame is used/unused within the frame itself ? |
There might not be any memory available for this information in the frame. For example, imagine that we want to map a frame as stack memory: The CPU will potentially use every byte in that frame. |
I meant in the |
The problem is that I think the |
Sounds good! |
I opened #89 with these changes. |
84: Make Mapper trait object safe by adding `Self: Sized` bounds on generic functions r=phil-opp a=phil-opp See #80 for more information I'm not quite sure whether this is a **breaking change**, but I think it is. 89: Add new UnsafePhysFrame type and use it in Mapper::map_to r=phil-opp a=phil-opp Fixes #88 This pull request adds a new `UnsafePhysFrame` type that wraps a `PhysFrame`. The type is unsafe to construct and the caller must guarantee that the frame is not mapped already. This type allows to make the `map_to` and `identity_map` methods of the `Mapper` trait safe. This PR also adjust the `FrameAllocator` to use the new type. This is a **breaking change**. Co-authored-by: Philipp Oppermann <dev@phil-opp.com>
84: Make Mapper trait object safe by adding `Self: Sized` bounds on generic functions r=phil-opp a=phil-opp See #80 for more information I'm not quite sure whether this is a **breaking change**, but I think it is. 89: Add new UnsafePhysFrame type and use it in Mapper::map_to r=phil-opp a=phil-opp Fixes #88 This pull request adds a new `UnsafePhysFrame` type that wraps a `PhysFrame`. The type is unsafe to construct and the caller must guarantee that the frame is not mapped already. This type allows to make the `map_to` and `identity_map` methods of the `Mapper` trait safe. This PR also adjust the `FrameAllocator` to use the new type. This is a **breaking change**. Co-authored-by: Philipp Oppermann <dev@phil-opp.com>
There are two methods in the
Mapper
trait that areunsafe
. What would it take to make them safe ? Could we, e.g., error or panic if theframe
is actually not unused ?The text was updated successfully, but these errors were encountered: