GaloisInc / dismantle

A library of assemblers and disassemblers derived from LLVM TableGen data
24 stars 5 forks source link

`arm-xml`: Reduce the number of FDs opened simultaneously #43

Closed RyanGlScott closed 6 months ago

RyanGlScott commented 6 months ago

Instead of using lazy IO to open many files in Template Haskell at compile time, which runs the risk of keeping all of the files' descriptors open simultaneously, we now load the entire contents of each file one at a time, which ensures that each file's descriptor is closed in sequence. This is critical to allow dismantle-arm-xml to be built on operating systems where the maximum number of file descriptors that can be opened at once is low (e.g., macOS, with a default maximum of 256).

Fixes #36.