RFR: 8331609: GenShen: Refactor generational mode allocations [v4]
Y. Srinivas Ramakrishna
ysr at openjdk.org
Fri May 10 00:31:17 UTC 2024
On Thu, 9 May 2024 23:58:02 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:
>> Why not call it `bool can_allocate(size_t bytes)` and expend with the need for the comment to resolve the reader's confusion from the naming?
>>
>>
>> // Check if there is space available to accommodate the allocation.
>> if (can_allocate(requested_bytes)) {
>> // the allocation might still fail because of alignment constraints
>> // or because of fragmentation of available space.
>> return true;
>> }
>
> I'd similarly adjust subsequent comments to not mention promotion specifically, but just call it `allocation_reserve` and `allocation`, instead of `promotion_reserve` and `promotion`.
Upon reading further and understanding how this is working, scratch the above suggestions.
We should leave things as they are here in terms of using `promotion` in the naming of the methods and the fields.
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/427#discussion_r1596111449
More information about the shenandoah-dev
mailing list