diff options
author | Elijah Newren <newren@gmail.com> | 2020-11-05 00:22:41 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-04 17:09:49 -0800 |
commit | 4fa1d501f775253fe70bf6c6a00fe8156c8c61c7 (patch) | |
tree | 0d3522fe42bdaf78b60c32d22767a6d57fd38207 /t/t4128-apply-root.sh | |
parent | strmap: enable faster clearing and reusing of strmaps (diff) | |
download | tgif-4fa1d501f775253fe70bf6c6a00fe8156c8c61c7.tar.xz |
strmap: add functions facilitating use as a string->int map
Although strmap could be used as a string->int map, one either had to
allocate an int for every entry and then deallocate later, or one had to
do a bunch of casting between (void*) and (intptr_t).
Add some special functions that do the casting. Also, rename put->set
for such wrapper functions since 'put' implied there may be some
deallocation needed if the string was already found in the map, which
isn't the case when we're storing an int value directly in the void*
slot instead of using the void* slot as a pointer to data.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4128-apply-root.sh')
0 files changed, 0 insertions, 0 deletions