Commit 162968cb authored by Camil Staps's avatar Camil Staps 🍃

Optimise getInterpreterSymbols

parent a8908359
Pipeline #24409 passed with stages
in 14 minutes and 45 seconds
......@@ -117,11 +117,17 @@ where
}
getInterpreterSymbols :: !Pointer -> [Symbol]
getInterpreterSymbols pgm = takeWhile (\s -> size s.symbol_name <> 0)
[getSymbol i \\ i <- [0..get_symbol_table_size pgm-1]]
getInterpreterSymbols pgm = getSymbols 0 (get_symbol_table_size pgm-1)
where
symbol_table = get_symbol_table pgm
getSymbols :: !Int !Int -> [Symbol]
getSymbols i max
| i > max = []
# sym = getSymbol i
| size sym.symbol_name == 0 = []
= [sym:getSymbols (i+1) max]
getSymbol :: !Int -> Symbol
getSymbol i
#! offset = symbol_table + i * IF_INT_64_OR_32 16 8 /* size of struct host_symbol */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment