Skip to main content

reintern_directives

Function reintern_directives 

Source
pub fn reintern_directives(directives: &mut [Spanned<Directive>]) -> usize
Expand description

Re-intern all strings in directives to deduplicate memory.

After deserializing from cache, strings are not interned (each is a separate allocation). This function walks through all directives and re-interns account names and currencies using a shared StringInterner, deduplicating identical strings to save memory.

Returns the number of strings that were deduplicated (i.e., strings that were found to already exist in the interner).