mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Add LayoutInterner to LayoutCache
Adds a thread-local interner of layouts to LayoutCache, and updates all references appropriately. This is a bit suboptimal for single-threaded workloads that will look at creating layout caches again, like the REPL, but I think that's okay for now - since the global interner will be uncontested for those workloads, it should still be plenty fast to access the interner, even behind a lock.
This commit is contained in:
parent
9d170be5c7
commit
c5466810a4
19 changed files with 177 additions and 86 deletions
|
@ -13,12 +13,12 @@ pub trait ReplApp<'a> {
|
|||
/// The `transform` callback takes the app's memory and the returned value
|
||||
fn call_function<Return, F>(&mut self, main_fn_name: &str, transform: F) -> Expr<'a>
|
||||
where
|
||||
F: Fn(&'a Self::Memory, Return) -> Expr<'a>,
|
||||
F: FnMut(&'a Self::Memory, Return) -> Expr<'a>,
|
||||
Self::Memory: 'a;
|
||||
|
||||
fn call_function_returns_roc_list<F>(&mut self, main_fn_name: &str, transform: F) -> Expr<'a>
|
||||
where
|
||||
F: Fn(&'a Self::Memory, (usize, usize, usize)) -> Expr<'a>,
|
||||
F: FnMut(&'a Self::Memory, (usize, usize, usize)) -> Expr<'a>,
|
||||
Self::Memory: 'a,
|
||||
{
|
||||
self.call_function(main_fn_name, transform)
|
||||
|
@ -51,7 +51,7 @@ pub trait ReplApp<'a> {
|
|||
transform: F,
|
||||
) -> T
|
||||
where
|
||||
F: Fn(&'a Self::Memory, usize) -> T,
|
||||
F: FnMut(&'a Self::Memory, usize) -> T,
|
||||
Self::Memory: 'a;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue