mirror of
https://github.com/eth-act/ere.git
synced 2026-04-25 03:00:10 -04:00
Refactor docs and make Input API more explicit (#235)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use ere_platform_risc0::{Platform, Risc0Platform};
|
||||
|
||||
type P = Risc0Platform;
|
||||
use ere_platform_risc0::risc0_zkvm::guest::env::read_slice;
|
||||
|
||||
fn main() {
|
||||
let alignment = u32::from_le_bytes(P::read_whole_input().try_into().unwrap()) as usize;
|
||||
let mut alignment = [0; 4];
|
||||
read_slice(&mut alignment);
|
||||
let alignment = u32::from_le_bytes(alignment) as usize;
|
||||
|
||||
let layout = std::alloc::Layout::from_size_align(1, alignment).unwrap();
|
||||
let ptr = unsafe { std::alloc::alloc(layout) };
|
||||
|
||||
Reference in New Issue
Block a user