RFR: 8333658: NMT: Use an allocator with 4-byte pointers to save memory in NativeCallStackStorage [v29]
Thomas Stuefe
stuefe at openjdk.org
Mon Jun 24 14:04:13 UTC 2024
On Mon, 24 Jun 2024 11:58:41 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> test/hotspot/gtest/nmt/test_homogenousObjectArray.cpp line 152:
>>
>>> 150: A::I i3 = alloc.allocate(0);
>>> 151: EXPECT_EQ(p1, &alloc.at(i3));
>>> 152: }
>>
>> I think for what little the tests do, testing with different list types is overengineered. You could just scrap both LL and LL2, and just use a HOA directly.
>
> I'd like to push back on that. I believe that while the list tests aren't testing that much they do serve as a form of example of how to use the HOA. It's also useful to have this in the form of a test, as opposed to a comment, as breaking changes to the HOA will break the examples, forcing them to be updated.
Hmm. I am not sold on the "example" benefit. The array is quite easy in itself.
You could scratch the lists, since their implementations don't do anything to really test the AWFL (new acronym, yay). For the saved LOCs could expand the tests to test with a collection of various types, e.g.
- u1, u2, u8
- unaligned structures that need alignment (e.g. struct (void*; int; ))
- trivial objects
Interesting to see would be that it works, that alignment is correct, that nothing breaks across resizes (indexes stay stable, etc.).
I wont insist of it, just thinking that the current test complexity is somewhat wasted.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18979#discussion_r1651089209
More information about the hotspot-dev
mailing list