Hello list,

the attached simple patch is a small part of the fix in Bug #53525, but it is independant and offers a noticeable performance improvement for track-macro-expansion. No regressions tested on x86, besides memory usage going up some KB.

I don't get why the max_column_hint was zeroed in every macro. Maybe there are pathological cases that I don't see?


2012-06-04  Dimitrios Apostolou <ji...@gmx.net>

        * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
        every macro. This improves performance by reducing the number of
        reallocations when track-macro-expansion is on.


Thanks
Dimitris
=== modified file 'libcpp/line-map.c'
--- libcpp/line-map.c   2012-04-30 11:42:12 +0000
+++ libcpp/line-map.c   2012-05-27 06:52:08 +0000
@@ -331,7 +331,6 @@ linemap_enter_macro (struct line_maps *s
          num_tokens * sizeof (source_location));
 
   LINEMAPS_MACRO_CACHE (set) = LINEMAPS_MACRO_USED (set) - 1;
-  set->max_column_hint = 0;
 
   return map;
 }

Reply via email to