]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/dwarf: allocate dwo_unit with new
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 12 May 2025 19:09:43 +0000 (15:09 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 23 May 2025 15:12:53 +0000 (11:12 -0400)
commite82c588969ab1542d7fb32f675e190897e28b64d
tree002463e9d6b278927f6dd599f226dc711b228865
parent8d13d83aba4a103959b127cbb5666e28667ac338
gdb/dwarf: allocate dwo_unit with new

The following patch reduces the duration where the dwo_lock mutex is
taken.  One operation that is not thread safe is the allocation on
dwo_units on the per_bfd obstack:

    dwo_unit *dwo_unit = OBSTACK_ZALLOC (&per_bfd->obstack, struct dwo_unit);

We could take the lock around this allocation, but I think it's just
easier to avoid the problem by having the dwo_unit objects allocated
with "new".

Change-Id: Ida04f905cb7941a8826e6078ed25dbcf57674090
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/read.c