-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
Disallowing this likely infrequent corner case is expected to have little or no impact to most applications. Unlikely use will, however, now cause an exception to be thrown.
-
SE
Summary
The linker should disallow sequences of a padding layout. The spec should reflect, that the linker only accepts a single padding layout before a non-padding layout and just one trailing padding layout in struct layouts.
Problem
It is possible, via a series of embedding constructs, to provide a sequence of only a padding layout to the Linker. This is problematic as various ABIs do not specify how such layouts should be handled. In C, it is not possible to declare a sequence of padding either, even though the FFM API should in theory be language agnostic.
The linker does not allow group layouts consisting of only padding layouts. This should be clarified in the documentation.
Solution
Explicitly disallow sequences of embedded padding elements and throw IllegalArgumentException
. GroupLayouts containing only padding layout are already rejected by the linker but this should be clarified in the documentation.
Specification
See attachment.
- csr of
-
JDK-8340205 Native linker allows MemoryLayout consisting of only PaddingLayout
- Closed