From 0638107918d31a5de7d6f01c5823e71542bcf339 Mon Sep 17 00:00:00 2001 From: Elichai Turkel Date: Fri, 28 Aug 2020 18:18:53 +0300 Subject: [PATCH] Adopt no-std tests to new preacllocated_* functions --- no_std_test/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/no_std_test/src/main.rs b/no_std_test/src/main.rs index fbf87a5..58e5c9c 100644 --- a/no_std_test/src/main.rs +++ b/no_std_test/src/main.rs @@ -53,6 +53,7 @@ use core::intrinsics; use core::panic::PanicInfo; use secp256k1::ecdh::SharedSecret; +use secp256k1::ffi::types::AlignedType; use secp256k1::rand::{self, RngCore}; use secp256k1::serde::Serialize; use secp256k1::*; @@ -82,7 +83,7 @@ impl RngCore for FakeRng { #[start] fn start(_argc: isize, _argv: *const *const u8) -> isize { - let mut buf = [0u8; 600_000]; + let mut buf = [AlignedType::zeroed(); 37_000]; let size = Secp256k1::preallocate_size(); unsafe { libc::printf("needed size: %d\n\0".as_ptr() as _, size) }; @@ -161,5 +162,5 @@ fn panic(info: &PanicInfo) -> ! { let mut buf = Print::new(); write(&mut buf, *msg).unwrap(); buf.print(); - unsafe { intrinsics::abort() } + intrinsics::abort() }