Skip to content
Snippets Groups Projects
Commit 0ecce056 authored by Timur Safin's avatar Timur Safin Committed by Igor Munkin
Browse files

debugger: use mhash for tarantool_debug_getsources

Refactor `tarantool_debug_getsource` implementation to
use mhash-based `mh_strnptr_find_str` function for
fast lookup in the hash map using given key.

Established set of function wrapping this functionality:

- `builtin_modcache_init` for creating map;
- `builtin_modcache_free` as destructor for map;
- `builtin_modcache_put` for adding new pair of
  (modname, lua code) into this hash map;
- `builtin_modcache_find` for fast lookup given
   short module name.

NB! We do not use keys in a form `@builtin/%s.lua` - we use
short module names instead.

NO_DOC=refactoring
NO_CHANGELOG=refactoring
NO_TEST=refactoring, older tests should still work
parent 67e79b15
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment