fix large enum variant size difference warning of PermVarAllocation

by wrapping BranchNumber in an Arc.
PermVarAllocation::Done had size 208 and is now down to 32.
A Box rather than an Arc would be smaller, but it looks like BranchNumber/BranchDesignator are clones a bunch so I expect it to be beneficial to reduce allocations both of the Box itself as well as its content.
This commit is contained in:
Skgland
2026-04-18 01:29:28 +02:00
parent f7dc1d72f6
commit ff293a56e6
5 changed files with 43 additions and 34 deletions

View File

@@ -25,6 +25,7 @@ use std::fmt;
use std::hash::{Hash, Hasher};
use std::ops::{AddAssign, Deref, DerefMut};
use std::path::PathBuf;
use std::sync::Arc;
pub type PredicateKey = (Atom, usize); // name, arity.
@@ -194,7 +195,7 @@ impl BranchNumber {
#[derive(Debug)]
pub enum ChunkedTerms {
Branch {
branch_nums: Vec<BranchNumber>,
branch_nums: Vec<Arc<BranchNumber>>,
arms: Vec<VecDeque<ChunkedTerms>>,
},
Chunk {