[PATCH] JDK-8176571: Fine bitmaps should be allocated as belonging to mtGC
Kim Barrett
kim.barrett at oracle.com
Mon May 22 20:49:42 UTC 2017
> On May 22, 2017, at 4:41 PM, Kim Barrett <kim.barrett at oracle.com> wrote:
>
>> On May 22, 2017, at 11:23 AM, Thomas Schatzl <thomas.schatzl at oracle.com> wrote:
>> We actually discussed this a little internally, and think that adding a
>> template parameter would pull out a lot of code from the cpp files into
>> the header files. As we kind of try to hide implementation as much as
>> possible, such a change would work against that goal.
>
> Not necessarily. CHeapBitMap could be split into a base class with
> allocation functions taking a MEMFLAGS argument, and a MEMFLAGS
> templated wrapper with allocation functions that pass that template
> parameter's value to the base class allocation function.
Or change CHeapBitMap allocation functions to have a *require* MEMFLAGS
parameter.
That still requires the addition of a runtime propagation path for that value, but
that’s going to be true for any solution that doesn’t move the allocation code
into a header. (Unless we want to explicitly specialize allocators in the .cpp
file on each MEMFLAGS value and do a runtime dispatch to select the templated
allocator, but yuck! and don’t go there.)
More information about the hotspot-gc-dev
mailing list