Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tim Crawford
uefi_alloc
Commits
5c299c2f
Commit
5c299c2f
authored
Jul 07, 2017
by
Jeremy Soller
Browse files
Add rust_allocate_zeroed
parent
bb9d0d3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib.rs
View file @
5c299c2f
...
...
@@ -40,6 +40,15 @@ pub extern fn __rust_allocate(size: usize, _align: usize) -> *mut u8 {
}
}
#[no_mangle]
pub
extern
fn
__rust_allocate_zeroed
(
size
:
usize
,
align
:
usize
)
->
*
mut
u8
{
use
core
::
ptr
;
let
ptr
=
__rust_allocate
(
size
,
align
);
unsafe
{
ptr
::
write_bytes
(
ptr
,
0
,
size
)
};
ptr
}
#[no_mangle]
pub
extern
fn
__rust_deallocate
(
ptr
:
*
mut
u8
,
_size
:
usize
,
_align
:
usize
)
{
if
let
Some
(
ref
mut
uefi
)
=
get_uefi
()
{
...
...
Write
Preview
Supports
Markdown
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