]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Use unique_ptr for objfiles
authorTom Tromey <tom@tromey.com>
Sat, 21 May 2022 15:50:13 +0000 (09:50 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 31 May 2022 20:46:11 +0000 (14:46 -0600)
commite2904e1ff0b0158cf6d8d335ca3f80ff7dc9eb6c
treea964217ffa81df1df4ec9236cb0a3696bf2ff3e4
parentebad7c66133526eb9ea9b21dad2df49a65200df0
Use unique_ptr for objfiles

A while back, I changed objfiles to be held via a shared_ptr.  The
idea at the time was that this was a step toward writing to the index
cache in the background, and this would let gdb keep a reference alive
to do so.  However, since then we've rewritten the DWARF reader, and
the new index can do this without requiring a shared pointer -- in
fact there are patches pending to implement this.

This patch switches objfile management to unique_ptr, which makes more
sense now.

Regression tested on x86-64 Fedora 34.
gdb/objfiles.c
gdb/objfiles.h
gdb/progspace.c
gdb/progspace.h