Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PdbInternalSectionOffset should derive Ord #138

Open
mstange opened this issue Jul 12, 2022 · 0 comments
Open

PdbInternalSectionOffset should derive Ord #138

mstange opened this issue Jul 12, 2022 · 0 comments

Comments

@mstange
Copy link
Collaborator

mstange commented Jul 12, 2022

It would be nice to be able to binary search offsets, and to use them as keys in a BTreeMap.

Here's a spot in pdb-addr2line which would be improved by an implementation of Ord on PdbInternalSectionOffset: https://github.com/mstange/pdb-addr2line/blob/f6cd33ab2192c69da6d79f44087ab41bb39804aa/src/lib.rs#L1165-L1168

Here's another spot, and in this case the exact ordering actually makes a difference:
https://github.com/mstange/pdb-addr2line/blob/f6cd33ab2192c69da6d79f44087ab41bb39804aa/src/lib.rs#L742-L756

We should order by section index first, and then by section-internal offset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant