RFR: 8314276: Improve PtrQueue API around size/capacity

Thomas Schatzl tschatzl at openjdk.org
Wed Aug 16 09:30:14 UTC 2023


On Tue, 15 Aug 2023 15:04:11 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> These changes simplify some uses of PtrQueue &etc and eliminate questions
> about where buffer capacity information should be obtained from, and whether
> it is correct.
> 
> This change
> 
> (1) Adds capacity information directly to BufferNode.  This is done without
> increasing the size of the header, by reducing the maximum buffer size and
> changing the index accordingly.  The new maximums are still much larger than
> actually needed for current uses.
> 
> (2) Removes PtrQueue::_capacity_in_bytes and obtain queue capacity from the
> associated buffer.  The capacity accessor was renamed to current_capacity to
> make it clear that the result may vary, at least depending on whether the
> queue currently has a buffer or not.
> 
> (3) Adds empty/size operations to PtrQueue/BufferNode.
> 
> (4) Updates users to take advantage of the above changes.
> 
> Each of those steps is a separate commit, in case that aids reviewing.
> 
> Testing:
> mach5 tier1-5

Marked as reviewed by tschatzl (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/15291#pullrequestreview-1580184822


More information about the hotspot-gc-dev mailing list