Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syscall
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
syscall
Commits
6cd82c63
Commit
6cd82c63
authored
Feb 10, 2020
by
4lDO2
🖖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enhance the Mmio API, and deprecate Mmio::new().
parent
6beba083
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
src/io/mmio.rs
src/io/mmio.rs
+16
-2
No files found.
src/io/mmio.rs
View file @
6cd82c63
...
...
@@ -11,9 +11,23 @@ pub struct Mmio<T> {
impl
<
T
>
Mmio
<
T
>
{
/// Create a new Mmio without initializing
#[deprecated
=
"unsound because it's possible to read even though it's uninitialized"
]
pub
fn
new
()
->
Self
{
Mmio
{
value
:
MaybeUninit
::
uninit
()
unsafe
{
Self
::
uninit
()
}
}
pub
unsafe
fn
zeroed
()
->
Self
{
Self
{
value
:
MaybeUninit
::
zeroed
(),
}
}
pub
unsafe
fn
uninit
()
->
Self
{
Self
{
value
:
MaybeUninit
::
uninit
(),
}
}
pub
const
fn
from
(
value
:
T
)
->
Self
{
Self
{
value
:
MaybeUninit
::
new
(
value
),
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment