Skip to content

Commit 0638107

Browse files
committed
Adopt no-std tests to new preacllocated_* functions
1 parent 767246a commit 0638107

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

no_std_test/src/main.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ use core::intrinsics;
5353
use core::panic::PanicInfo;
5454

5555
use secp256k1::ecdh::SharedSecret;
56+
use secp256k1::ffi::types::AlignedType;
5657
use secp256k1::rand::{self, RngCore};
5758
use secp256k1::serde::Serialize;
5859
use secp256k1::*;
@@ -82,7 +83,7 @@ impl RngCore for FakeRng {
8283

8384
#[start]
8485
fn start(_argc: isize, _argv: *const *const u8) -> isize {
85-
let mut buf = [0u8; 600_000];
86+
let mut buf = [AlignedType::zeroed(); 37_000];
8687
let size = Secp256k1::preallocate_size();
8788
unsafe { libc::printf("needed size: %d\n\0".as_ptr() as _, size) };
8889

@@ -161,5 +162,5 @@ fn panic(info: &PanicInfo) -> ! {
161162
let mut buf = Print::new();
162163
write(&mut buf, *msg).unwrap();
163164
buf.print();
164-
unsafe { intrinsics::abort() }
165+
intrinsics::abort()
165166
}

0 commit comments

Comments
 (0)