review request (S) - 8057818: collect allocation context stats

Mikael Gerdin mikael.gerdin at oracle.com
Tue Sep 9 09:43:33 UTC 2014


Hi John,

On Tuesday 09 September 2014 00.00.58 John Coomes wrote:
> Hi,
> 
> Please review an interface for collecting allocation context
> statistics at g1 gc pauses:
> 
> 8057818: collect allocation context statistics at gc pauses
> 
> http://cr.openjdk.java.net/~jcoomes/8u/8u40/8057818-stats-collect/

Why don't you inline the AllocationContextStats inside the class declaration 
instead? It looks weird that the class just above uses that pattern and this 
class doesn't. You don't really need to declare an inline emtpy default 
constructor.

We usually keep the "&" reference operator next to the type, just like we do 
with pointer types:
  inline AllocationContextStats& allocation_context_stats();
and
  inline AllocationContextStats& G1CollectedHeap::allocation_context_stats() {

there's not really any point to keeping the implementation of 
allocation_context_stats() in the .inline.hpp file since G1CollectedHeap needs 
the full class declaration of AllocationContextStats to determine its size 
since it's embedded in the G1CollectedHeap object.

/Mikael

> 
> -John




More information about the hotspot-gc-dev mailing list