From bbf4d912ccdd9b397c82c7f1e85bb83df610b9a3 Mon Sep 17 00:00:00 2001 From: tjjfvi Date: Thu, 21 Mar 2024 07:56:02 -0400 Subject: [PATCH] upgrade hvmc version --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/lib.rs | 10 +++++----- src/main.rs | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7ad8d9447..e731ae7b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,8 +207,8 @@ checksum = "809e18805660d7b6b2e2b9f316a5099521b5998d5cba4dda11b5157a21aaef03" [[package]] name = "hvm-core" -version = "0.2.19" -source = "git+https://github.com/HigherOrderCO/hvm-core.git?branch=feature/sc-506/smart-pointer-def-api#fcb44d972fca4c026a714ab6770788ac4c7b3741" +version = "0.2.20" +source = "git+https://github.com/HigherOrderCO/hvm-core.git#acbc4295283472925426eee97a2f85e4686adba2" dependencies = [ "arrayvec", "clap", diff --git a/Cargo.toml b/Cargo.toml index 3c9c0e70b..f9f8ac155 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ cli = ["dep:clap"] chumsky = { version = "= 1.0.0-alpha.4", features = ["label"] } clap = { version = "4.4.1", features = ["derive"], optional = true } highlight_error = "0.1.1" -hvm-core = { git = "https://github.com/HigherOrderCO/hvm-core.git", branch = "feature/sc-506/smart-pointer-def-api" } +hvm-core = { git = "https://github.com/HigherOrderCO/hvm-core.git" } indexmap = "2.2.3" interner = "0.2.1" itertools = "0.11.0" diff --git a/src/lib.rs b/src/lib.rs index 9eccf45ce..318ccad21 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,7 +47,7 @@ pub fn compile_book( let mut core_book = nets_to_hvmc(nets, &mut diagnostics)?; if opts.pre_reduce { - core_book.pre_reduce(&|x| x == book.hvmc_entrypoint(), 1 << 24, 100_000); + core_book.pre_reduce(&|x| x == book.hvmc_entrypoint(), None, 100_000); } if opts.prune { prune_defs(&mut core_book, book.hvmc_entrypoint().to_string()); @@ -153,7 +153,7 @@ pub fn desugar_book( pub fn run_book( mut book: Book, - max_memory: usize, + max_memory: Option, run_opts: RunOpts, compile_opts: CompileOpts, diagnostics_cfg: DiagnosticsConfig, @@ -209,12 +209,12 @@ pub fn count_nodes<'l>(net: &'l hvmc::ast::Net) -> usize { pub fn run_compiled( host: Arc>, - mem_size: usize, + mem_size: Option, run_opts: RunOpts, hook: Option, entrypoint: &str, ) -> (Net, RunStats) { - let heap = Heap::new_bytes(mem_size); + let heap = Heap::new(mem_size).expect("memory allocation failed"); let mut root = DynNet::new(&heap, run_opts.lazy_mode); let max_rwts = run_opts.max_rewrites.map(|x| x.clamp(usize::MIN, usize::MAX)); // Expect won't be reached because there's @@ -293,7 +293,7 @@ pub struct RunOpts { pub debug: bool, pub linear: bool, pub lazy_mode: bool, - pub max_memory: usize, + pub max_memory: Option, pub max_rewrites: Option, } diff --git a/src/main.rs b/src/main.rs index 589c4d235..c62dc27ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,8 +50,8 @@ enum Mode { }, /// Compiles the program and runs it with the hvm. Run { - #[arg(short = 'm', long = "mem", help = "How much memory to allocate for the runtime", default_value = "1G", value_parser = mem_parser)] - max_memory: usize, + #[arg(short = 'm', long = "mem", help = "How much memory to allocate for the runtime", value_parser = mem_parser)] + max_memory: Option, #[arg(short = 'r', long = "rwts", help = "Maximum amount of rewrites", value_parser = mem_parser)] max_rewrites: Option,