adjust the generation of the LIBRARIES map

pre-genrate constants instaed of driectly genrating the literal for the insert
This commit is contained in:
Bennet Bleßmann
2024-07-06 03:44:53 +02:00
parent 52fa51853e
commit d2d451b182
2 changed files with 61 additions and 20 deletions

View File

@@ -111,13 +111,17 @@ impl LoadContext {
#[inline]
fn current_dir() -> PathBuf {
if !cfg!(miri) {
env::current_dir().unwrap_or(PathBuf::from("./"))
env::current_dir().unwrap_or(PathBuf::from("./"))
} else {
PathBuf::from("./")
}
}
include!(concat!(env!("OUT_DIR"), "/libraries.rs"));
mod libraries {
include!(concat!(env!("OUT_DIR"), "/libraries.rs"));
}
pub(crate) use libraries::LIBRARIES;
pub static BREAK_FROM_DISPATCH_LOOP_LOC: usize = 0;
pub static INSTALL_VERIFY_ATTR_INTERRUPT: usize = 1;
@@ -492,7 +496,7 @@ impl Machine {
bootstrapping_compile(
Stream::from_static_string(
LIBRARIES.borrow()["ops_and_meta_predicates"],
libraries::LIBRARIES.borrow()["ops_and_meta_predicates"],
&mut wam.machine_st.arena,
),
&mut wam,