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

@@ -7,6 +7,7 @@ use std::cell::Cell;
use std::collections::VecDeque;
use std::iter::*;
use std::rc::Rc;
use std::sync::Arc;
use std::vec::Vec;
#[allow(clippy::borrowed_box)]
@@ -320,7 +321,7 @@ pub(crate) fn breadth_first_iter(
enum ClauseIteratorState<'a> {
RemainingChunks(&'a VecDeque<ChunkedTerms>, usize),
RemainingBranches(
&'a Vec<BranchNumber>,
&'a Vec<Arc<BranchNumber>>,
&'a Vec<VecDeque<ChunkedTerms>>,
usize,
),
@@ -329,11 +330,11 @@ enum ClauseIteratorState<'a> {
#[derive(Debug, Clone)]
pub(crate) enum ClauseItem<'a> {
FirstBranch {
branch_num: &'a BranchNumber,
branch_num: &'a Arc<BranchNumber>,
num_branches: usize,
},
NextBranch {
branch_num: &'a BranchNumber,
branch_num: &'a Arc<BranchNumber>,
},
BranchEnd {
depth: usize,