Refactor docs and make Input API more explicit (#235)

This commit is contained in:
Han
2025-12-06 12:02:14 +09:00
committed by GitHub
parent 3d844b9f8b
commit 8f6cee8a32
64 changed files with 1297 additions and 456 deletions

View File

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