RFR: 8316694: Implement relocation of nmethod within CodeCache [v4]

Evgeny Astigeevich eastigeevich at openjdk.org
Mon Mar 17 21:52:09 UTC 2025


On Mon, 17 Mar 2025 21:27:21 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Without I get the following error
>> 
>> error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class nmethod’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
>
> Okay, we need to ask C++ experts here.

You should not disable this warning. 
It says `nmethed` class is not trivially copyable type which means `memcpy` cannot used for it.
Our options to fix:
- Make `nmethod` trivially copyable type.
- Get back to use the operator new and the contructor.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r1999718015


More information about the hotspot-compiler-dev mailing list