Adopt no-std tests to new preacllocated_* functions
This commit is contained in:
parent
767246a282
commit
0638107918
|
@ -53,6 +53,7 @@ use core::intrinsics;
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
use secp256k1::ecdh::SharedSecret;
|
use secp256k1::ecdh::SharedSecret;
|
||||||
|
use secp256k1::ffi::types::AlignedType;
|
||||||
use secp256k1::rand::{self, RngCore};
|
use secp256k1::rand::{self, RngCore};
|
||||||
use secp256k1::serde::Serialize;
|
use secp256k1::serde::Serialize;
|
||||||
use secp256k1::*;
|
use secp256k1::*;
|
||||||
|
@ -82,7 +83,7 @@ impl RngCore for FakeRng {
|
||||||
|
|
||||||
#[start]
|
#[start]
|
||||||
fn start(_argc: isize, _argv: *const *const u8) -> isize {
|
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();
|
let size = Secp256k1::preallocate_size();
|
||||||
unsafe { libc::printf("needed size: %d\n\0".as_ptr() as _, 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();
|
let mut buf = Print::new();
|
||||||
write(&mut buf, *msg).unwrap();
|
write(&mut buf, *msg).unwrap();
|
||||||
buf.print();
|
buf.print();
|
||||||
unsafe { intrinsics::abort() }
|
intrinsics::abort()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue