0

I need to store all debugging symbols (for simplicity, only function names + addresses). I do not have function sizes. Like:

_printf 0x1234

_fprintf 0x1255

_scanf 0x1300

I need a very fast algorithm for determining function name by address, for example:

0x1258 - _fprintf+0x3

Simple STL map is far from useful. What data structure will fit here?

Community
  • 1
  • 1

2 Answers2

0

You need to map word-sized keys to a string table? An endian patricia trie should be both time and space efficient. One bit in the int tag per branch. Also known an Int Maps in some communities.

Don Stewart
  • 137,316
  • 36
  • 365
  • 468
  • Oh no, difference between values are not string lengths, but function lengths in bytes. –  May 22 '12 at 16:40
0

It simpler that I thought: just use STL map::lower_bound().