aboutsummaryrefslogtreecommitdiff
path: root/gdb/m32r-linux-nat.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2025-03-09 10:14:34 -0600
committerTom Tromey <tom@tromey.com>2025-03-10 15:05:34 -0600
commit2609ee6f193505ec96552a9c33ecdea679242114 (patch)
treeaaee82417fd309a6f29462ec704db67134e90941 /gdb/m32r-linux-nat.c
parentc19c928f7b303697345ea368923cc798cad2102d (diff)
downloadbinutils-2609ee6f193505ec96552a9c33ecdea679242114.zip
binutils-2609ee6f193505ec96552a9c33ecdea679242114.tar.gz
binutils-2609ee6f193505ec96552a9c33ecdea679242114.tar.bz2
Add string cache and use it in cooked index
The cooked index needs to allocate names in some cases -- when canonicalizing or when synthesizing Ada package names. This process currently uses a vector of unique_ptrs to manage the memory. Another series I'm writing adds another spot where this allocation must be done, and examining the result showed that certain names were allocated multiple times. To clean this up, this patch introduces a string cache object and changes the cooked indexer to use it. I considered using bcache here, but bcache doesn't work as nicely with string_view -- because bcache is fundamentally memory-based, a temporary copy of the contents must be made to ensure that bcache can see the trailing \0. Furthermore, writing a custom class lets us avoid another copy when canonicalizing C++ names. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/m32r-linux-nat.c')
0 files changed, 0 insertions, 0 deletions