introduce InlineTermStream to avoid arena allocations during call_inline (#1576)

This commit is contained in:
Mark Thom
2022-11-08 23:55:22 +01:00
parent d91ee5b77c
commit 9366a48d6d
3 changed files with 84 additions and 14 deletions

View File

@@ -2428,9 +2428,9 @@ impl Machine {
module_name: HeapCellValue,
key: PredicateKey,
) -> CodeIndex {
let mut loader: Loader<'_, LiveLoadAndMachineState<'_>> = Loader::new(
let mut loader: Loader<'_, InlineLoadState<'_>> = Loader::new(
self,
LiveTermStream::new(ListingSource::User),
InlineTermStream {},
);
let module_name = if module_name.get_tag() == HeapCellValueTag::Atom {
@@ -2448,9 +2448,9 @@ impl Machine {
vars: &[Term],
) -> Result<(), SessionError> {
let mut compile = || {
let mut loader: Loader<'_, LiveLoadAndMachineState<'_>> = Loader::new(
let mut loader: Loader<'_, InlineLoadState<'_>> = Loader::new(
self,
LiveTermStream::new(ListingSource::User),
InlineTermStream {},
);
let term = loader.read_term_from_heap(term_loc)?;