-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
19
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The size of the returned symbol is 0.
In order to access the POSIX variable timezone of time.h one needs a extra conversation to MemoryAddress.
MemorySegment timezone = SymbolLookup.lookup("timezone").get()
timezone.address().get(ValueLayout.JAVA_LONG, 0)
but having a size
MemorySegment timezone = SymbolLookup.lookup("timezone", 8).get()
timezone.get(ValueLayout.JAVA_LONG, 0)
This would preserve the MemorySession of the SymbolLookup instance and eliminate the transformation to MemoryAddress.
Storing only the MemoryAddress would complete eliminate the MemorySession, this could lead to other problems.
The size of the returned symbol is 0.
In order to access the POSIX variable timezone of time.h one needs a extra conversation to MemoryAddress.
MemorySegment timezone = SymbolLookup.lookup("timezone").get()
timezone.address().get(ValueLayout.JAVA_LONG, 0)
but having a size
MemorySegment timezone = SymbolLookup.lookup("timezone", 8).get()
timezone.get(ValueLayout.JAVA_LONG, 0)
This would preserve the MemorySession of the SymbolLookup instance and eliminate the transformation to MemoryAddress.
Storing only the MemoryAddress would complete eliminate the MemorySession, this could lead to other problems.