let-def / owee

OCaml library to work with DWARF format
MIT License
33 stars 12 forks source link

Convert u64 from int to int64 #10

Closed gretay-js closed 5 years ago

gretay-js commented 5 years ago

This PR changes the implementation of u64 from int to int64 to accommodate large values correctly when reading them from elf headers, etc. Note that addresses into binaries are still represented as int (not converted to int64), because (a) the size of Bigarray.Array1 is int, and (b) it's impossible to create such larger binaries anyway, let alone manipulate them.

There might be a performance penalty from this change. This version has more allocation (boxed int64) and extra conversions back and forth between int addresses and int64 values. In practice, I used it to read large elf binaries and haven't noticed anything dramatic in the client of owee. I haven't measured performance impact of this change on its own. I am happy to do it if this is a concern.

This PR also makes a trivial change along the way: rename Owee_debug_line.dim to size, to address a previous CR comment.

let-def commented 5 years ago

Thanks :)