We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 688bc7f + d953f72 commit e115a58Copy full SHA for e115a58
src/lib.rs
@@ -97,6 +97,18 @@ pub extern "C" fn __rust_allocate(size: usize, align: usize) -> *mut u8 {
97
})
98
}
99
100
+#[doc(hidden)]
101
+#[no_mangle]
102
+pub extern fn __rust_allocate_zeroed(size: usize, align: usize) -> *mut u8 {
103
+ let ptr = __rust_allocate(size, align);
104
+ if !ptr.is_null() {
105
+ unsafe {
106
+ ptr::write_bytes(ptr, 0, size);
107
+ }
108
109
+ ptr
110
+}
111
+
112
/// Rust de-allocation function (c.f. free)
113
#[doc(hidden)]
114
#[no_mangle]
0 commit comments