Skip to content

Commit

Permalink
upgrade hvmc version
Browse files Browse the repository at this point in the history
  • Loading branch information
tjjfvi committed Mar 21, 2024
1 parent 26da3d3 commit bbf4d91
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -153,7 +153,7 @@ pub fn desugar_book(

pub fn run_book(
mut book: Book,
max_memory: usize,
max_memory: Option<usize>,
run_opts: RunOpts,
compile_opts: CompileOpts,
diagnostics_cfg: DiagnosticsConfig,
Expand Down Expand Up @@ -209,12 +209,12 @@ pub fn count_nodes<'l>(net: &'l hvmc::ast::Net) -> usize {

pub fn run_compiled(
host: Arc<Mutex<Host>>,
mem_size: usize,
mem_size: Option<usize>,
run_opts: RunOpts,
hook: Option<impl FnMut(&Net)>,
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
Expand Down Expand Up @@ -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<usize>,
pub max_rewrites: Option<usize>,
}

Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<usize>,

#[arg(short = 'r', long = "rwts", help = "Maximum amount of rewrites", value_parser = mem_parser)]
max_rewrites: Option<usize>,
Expand Down

0 comments on commit bbf4d91

Please sign in to comment.