mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Push layout interner further through Layout
This commit is contained in:
parent
ed04c2040a
commit
3b4b1838b8
34 changed files with 1279 additions and 634 deletions
|
@ -182,6 +182,14 @@ impl<'a, K: Hash + Eq> Interner<'a, K> for ThreadLocalInterner<'a, K> {
|
|||
}
|
||||
|
||||
impl<'a, K> SingleThreadedInterner<'a, K> {
|
||||
/// Creates a new single threaded interner with the given capacity.
|
||||
pub fn with_capacity(cap: usize) -> Self {
|
||||
Self {
|
||||
map: BumpMap::with_capacity_and_hasher(cap, default_hasher()),
|
||||
vec: Vec::with_capacity(cap),
|
||||
}
|
||||
}
|
||||
|
||||
/// Promotes the [SingleThreadedInterner] back to a [GlobalInterner].
|
||||
///
|
||||
/// You should *only* use this if you need to go from a single-threaded to a concurrent context,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue