On 18/02/2020 03:52, Chris T wrote:
Maurizio, thank you for your suggestion! One of my coworkers suggested
also using padding instead of keeping a compact/packed memory layout.
The reason my example worked was because Java char is 2 bytes and int
is 4... So using 16-bit alignment for
Maurizio, thank you for your suggestion! One of my coworkers suggested also
using padding instead of keeping a compact/packed memory layout.
The reason my example worked was because Java char is 2 bytes and int is
4... So using 16-bit alignment for "creditScore" the was the common
denominator.
Hi Chris,
thanks for the links - took a look at your first test and, more
specifically at example03SSNToCreditScore:
MemoryLayout ssnAndCreditStruct = MemoryLayout.ofStruct(
MemoryLayout.ofSequence(9,
MemoryLayout.ofValueBits(Character.SIZE, order)).withName("ssn"),
Maurizio, thanks for pointing the bug out - however I don't think I was
impacted by it.
I agree with you that a more complex examples might distract the audience
from the main presentation points.
As mentioned in one of my previous email, I finalized some examples myself:
1. One example for
On 13/02/2020 03:39, Chris T wrote:
No problem! Nice talk at FOSDEM, Maurizio ;-)!
One suggestion, for future talks - when it comes to memory layouts
please construct an example that is a little bit more complex (by end
of the upcoming weekend I will publish one that can be used). I had
No problem! Nice talk at FOSDEM, Maurizio ;-)!
One suggestion, for future talks - when it comes to memory layouts please
construct an example that is a little bit more complex (by end of the
upcoming weekend I will publish one that can be used). I had trouble with
bit alignment when working on
Thanks Paul!
Maurizio
On 10/02/2020 17:58, Paul Sandoz wrote:
I modified the JEP with updated code snippets that compile against the latest
API in JDK 14 [*].
Thanks Chris, both for catching the mistake and for testing out the
feature - as you can imagine we'd like to collect as much feedback as
possible to make sure the API gets finalized right.
Cheers
Maurizio
On 11/02/2020 02:12, Chris T wrote:
Paul, thank you very much!
In the meantime I
Paul, thank you very much!
In the meantime I did more reading about VarHandles and understood better
the "philosophy" of coordinates and it made sense (eventually I was able to
fix my own issues).
Also, thank you for sharing Maurizio's talk - I will refer it in my
examples. Speaking of
Thanks for pointing out the inconsistencies.
I modified the JEP with updated code snippets that compile against the latest
API in JDK 14 [*].
The handle created “withStride” requires an additional coordinate the is an
offset from the base address.
You may find Maurizio’s recent talk at Fosdem
I tried to build an example on top of this code snippet (from the JEP text):
VarHandle intHandle = MemoryHandles.varHandle(int.class);
VarHandle intElemHandle = MemoryHandles.withStride(intHandle, 4);
try (MemorySegment segment = MemorySegment.allocateNative(100)) {
MemoryAddress base =
11 matches
Mail list logo