Commit 0de2420c authored by Tom Tromey's avatar Tom Tromey
Browse files

Use memcpy in minimal_symbol_reader::install

minimal_symbol_reader::install copies minsyms from the msym_bunch
objects into the allocated memory.  It seemed better to me to do this
via memcpy, as that is frequently optimized in libc.

gdb/ChangeLog
2019-03-15  Tom Tromey  <tom@tromey.com>

	* minsyms.c (minimal_symbol_reader::install): Use memcpy.
parent 042d75e4
2019-03-15 Tom Tromey <tom@tromey.com>
* minsyms.c (minimal_symbol_reader::install): Use memcpy.
2019-03-15 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile_per_bfd_storage) <msymbols>: Now a
......
......@@ -1337,7 +1337,6 @@ build_minimal_symbol_hash_tables (struct objfile *objfile)
void
minimal_symbol_reader::install ()
{
int bindex;
int mcount;
struct msym_bunch *bunch;
struct minimal_symbol *msymbols;
......@@ -1384,8 +1383,9 @@ minimal_symbol_reader::install ()
for (bunch = m_msym_bunch; bunch != NULL; bunch = bunch->next)
{
for (bindex = 0; bindex < m_msym_bunch_index; bindex++, mcount++)
msymbols[mcount] = bunch->contents[bindex];
memcpy (&msymbols[mcount], &bunch->contents[0],
m_msym_bunch_index * sizeof (struct minimal_symbol));
mcount += m_msym_bunch_index;
m_msym_bunch_index = BUNCH_SIZE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment