Skip to main content

fold_symbols

Function fold_symbols 

Source
pub fn fold_symbols<'data, State>(
    macho: &MachoFile<'data>,
    state: State,
    folder: impl FnMut(&mut State, Symbol<'data>) -> Result<(), ParseError>,
) -> Result<State, ParseError>
Expand description

Fold raw nlist entries in physical symbol-table order without first materializing a SymbolTable.

This performs one pass over the nlist entries. The accumulator is returned only after every entry and referenced string-table name has parsed successfully. If a later entry is malformed, the partially folded accumulator is dropped and only the parse error is returned. The caller controls retained memory through the accumulator and need not collect Symbol values.