Integrated: 8317432: Async UL: Use memcpy instead of strcpy in Message ctr

Johan Sjölen jsjolen at openjdk.org
Fri Oct 13 12:14:31 UTC 2023


On Tue, 3 Oct 2023 14:25:38 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> Hi,
> 
> This change does three things:
> 
> 1. At construction of message we used to compute `strlen` and then `strcpy`, we change this to do only one `strlen` and then a `memcpy` instead.
> 2. A `strlen` used to be required to calculate the size when finding the next message in the iterator. We instead store the previously computed message length and so the `strlen` is no longer necessary. The cost of this is 8 bytes extra per message (64 -> 72 bytes).
> 3. There's also some code which alters the alignment to explicitly handle the alignment of `Message` and ensure that `_pos` starts at a `Message`-aligned pointer.

This pull request has now been integrated.

Changeset: e490cf9c
Author:    Johan Sjölen <jsjolen at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e490cf9c650cfd3395e8418de99fbd42fd0d56ef
Stats:     18 lines in 2 files changed: 9 ins; 1 del; 8 mod

8317432: Async UL: Use memcpy instead of strcpy in Message ctr

Reviewed-by: xliu, dholmes

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

PR: https://git.openjdk.org/jdk/pull/16029


More information about the hotspot-runtime-dev mailing list