This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Make GC tuning parameters adjustable at runtime


#ifndef GGC_ALWAYS_COLLECT
  if (G.allocated < GGC_MIN_EXPAND_FOR_GC * G.allocated_last_gc)
    return;
#endif

where GGC_MIN_EXPAND_FOR_GC is a #define for the floating point
constant 1.3.

After:

  size_t allocated_last_gc =
    MAX (G.allocated_last_gc, (size_t)PARAM_VALUE (GGC_MIN_HEAPSIZE) *
1024);

  size_t min_expand = allocated_last_gc * PARAM_VALUE (GGC_MIN_EXPAND) /
100;

  if (G.allocated < allocated_last_gc + min_expand)
    return;
That should be fine; as long as we're not changing stuff in the
per-object mark path, we're OK.

The patch is fine; check it in.  Thanks!

--
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]