Use obstack_blank_fast to shrink obstacks
authorAlan Modra <amodra@gmail.com>
Tue, 4 Nov 2014 08:55:34 +0000 (19:25 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 5 Nov 2014 06:08:02 +0000 (16:38 +1030)
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
gdb/charset.c
gdb/minsyms.c

index e51a13733495972a3d07eddfcecc900cc474a526..f347b89c00b49d72aaf2879458dad18615bbb377 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-05  Alan Modra  <amodra@gmail.com>
+
+       * charset.c (convert_between_encodings): Shrink obstack using
+       obstack_blank_fast.
+       * minsyms.c (install_minimal_symbols): Likewise.
+
 2014-11-04  Simon Marchi  <simon.marchi@ericsson.com>
 
        * tui/tui.c (tui_enable): Pass stdout and stdin to newterm.
index bc7bd6593e4f04aa3b6fbeb007adf225d6546952..94ad0203764e0cdb0717cd3b9ea690ee2c2b7736 100644 (file)
@@ -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)
        {
index 8eb7c85d3d8e3ef2c5aac0a1f1e4175ee50ee6f7..2463be441e0ab848fe76c306b96668912b084f1a 100644 (file)
@@ -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);