We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a91ad0d commit cf7894eCopy full SHA for cf7894e
src/allocator.rs
@@ -12,6 +12,8 @@
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
+use std::mem::MaybeUninit;
16
+
17
#[cfg(feature = "wee-alloc")]
18
#[global_allocator]
19
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
@@ -22,7 +24,7 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
22
24
)]
23
25
#[no_mangle]
26
pub extern "C" fn proxy_on_memory_allocate(size: usize) -> *mut u8 {
- let mut vec: Vec<u8> = Vec::with_capacity(size);
27
+ let mut vec: Vec<MaybeUninit<u8>> = Vec::with_capacity(size);
28
unsafe {
29
vec.set_len(size);
30
}
0 commit comments