Adopt no-std tests to new preacllocated_* functions

This commit is contained in:
Elichai Turkel 2020-08-28 18:18:53 +03:00
parent 767246a282
commit 0638107918
No known key found for this signature in database
GPG Key ID: 9383CDE9E8E66A7F
1 changed files with 3 additions and 2 deletions

View File

@ -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()
}