RFR: 8312132: Add tracking of multiple address spaces in NMT [v89]

Johan Sjölen jsjolen at openjdk.org
Fri May 17 07:28:15 UTC 2024


On Thu, 16 May 2024 15:22:44 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Add corresponding tests to visit_in_order when applicable
>>  - Remove usage of auto in tests
>
> src/hotspot/share/utilities/nativeCallStack.hpp line 57:
> 
>> 55: 
>> 56: class NativeCallStack : public StackObj {
>> 57:   friend class VMATreeTest;
> 
> I am surprised friend is needed, the private section of this class being so tiny. What does friend give you what you could not get via normal accessors?

This permits access to the `_tree` field, so we can inspect it to check that it conforms to the shape we expect it to be. I don't think that we should have an accessor to that field, as that forms a part of its public interface.

Test fixtures being friend classes is imo not a code smell, but a natural consequence of doing clear box testing.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18289#discussion_r1604469265


More information about the hotspot-dev mailing list