RFR: 8269537: memset() is called after operator new [v3]
Leo Korinth
lkorinth at openjdk.java.net
Tue Oct 19 13:38:50 UTC 2021
On Thu, 7 Oct 2021 06:21:09 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Use a thread local buffer so that the compiler might reorder operator new.
>
> src/hotspot/share/memory/allocation.hpp line 416:
>
>> 414: static const unsigned BufferSize = 5;
>> 415: uintptr_t _begin[BufferSize];
>> 416: uintptr_t _past_end[BufferSize];
>
> I think these should be `const void*` rather than `uintptr_t`.
Why do you think it is better? Comparing integers might possibly be preferable from comparing pointers from *different* objects that is undefined if I remember correctly. Of course casting them to integers probably does not make it that much better defined, but it feels at least a bit better... I will change it if you still prefer pointer comparison.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5387
More information about the hotspot-dev
mailing list