Skip to content

Commit d953f72

Browse files
authored
write_bytes is unsafe
1 parent 892e48f commit d953f72

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ pub extern "C" fn __rust_allocate(size: usize, align: usize) -> *mut u8 {
102102
pub extern fn __rust_allocate_zeroed(size: usize, align: usize) -> *mut u8 {
103103
let ptr = __rust_allocate(size, align);
104104
if !ptr.is_null() {
105-
ptr::write_bytes(ptr, 0, size);
105+
unsafe {
106+
ptr::write_bytes(ptr, 0, size);
107+
}
106108
}
107109
ptr
108110
}

0 commit comments

Comments
 (0)