From ee11262d06cc6af9d900b44cb4d9af29050b375f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 4 Nov 2014 19:25:34 +1030 Subject: [PATCH] Use obstack_blank_fast to shrink obstacks obstack_blank isn't the correct macro to call for shrinking obstacks since it does size checking. * charset.c (convert_between_encodings): Shrink obstack using obstack_blank_fast. * minsyms.c (install_minimal_symbols): Likewise. --- gdb/ChangeLog | 6 ++++++ gdb/charset.c | 2 +- gdb/minsyms.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e51a1373349..f347b89c00b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2014-11-05 Alan Modra + + * charset.c (convert_between_encodings): Shrink obstack using + obstack_blank_fast. + * minsyms.c (install_minimal_symbols): Likewise. + 2014-11-04 Simon Marchi * tui/tui.c (tui_enable): Pass stdout and stdin to newterm. diff --git a/gdb/charset.c b/gdb/charset.c index bc7bd6593e4..94ad0203764 100644 --- a/gdb/charset.c +++ b/gdb/charset.c @@ -506,7 +506,7 @@ convert_between_encodings (const char *from, const char *to, /* Now make sure that the object on the obstack only includes bytes we have converted. */ - obstack_blank (output, - (int) outleft); + obstack_blank_fast (output, -outleft); if (r == (size_t) -1) { diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 8eb7c85d3d8..2463be441e0 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -1270,7 +1270,7 @@ install_minimal_symbols (struct objfile *objfile) mcount = compact_minimal_symbols (msymbols, mcount, objfile); - obstack_blank (&objfile->per_bfd->storage_obstack, + obstack_blank_fast (&objfile->per_bfd->storage_obstack, (mcount + 1 - alloc_count) * sizeof (struct minimal_symbol)); msymbols = (struct minimal_symbol *) obstack_finish (&objfile->per_bfd->storage_obstack); -- 2.30.2