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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user