Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v6]

2024-04-17 Thread Per Minborg
> This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly > aligned for any given layout (e.g. following a

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v5]

2024-04-16 Thread Maurizio Cimadamore
On Tue, 16 Apr 2024 09:39:02 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update JavaDoc > > src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 612: > >> 610: *

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v5]

2024-04-16 Thread Maurizio Cimadamore
On Tue, 16 Apr 2024 07:49:26 GMT, Per Minborg wrote: >> This PR proposes to add a new method `MemorySegment::maxByteAlignment` that >> returns the maximum byte alignment of a segment (both heap and native >> segments). >> >> Clients can then use this method to determine if a segment is

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v5]

2024-04-16 Thread Per Minborg
> This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly > aligned for any given layout (e.g. following a

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v4]

2024-04-16 Thread Per Minborg
> This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly > aligned for any given layout (e.g. following a

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v3]

2024-04-15 Thread Jorn Vernee
On Mon, 15 Apr 2024 14:21:23 GMT, Per Minborg wrote: >> This PR proposes to add a new method `MemorySegment::maxByteAlignment` that >> returns the maximum byte alignment of a segment (both heap and native >> segments). >> >> Clients can then use this method to determine if a segment is

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v3]

2024-04-15 Thread Maurizio Cimadamore
On Mon, 15 Apr 2024 14:39:02 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains ten additional >>

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v3]

2024-04-15 Thread Maurizio Cimadamore
On Mon, 15 Apr 2024 14:21:23 GMT, Per Minborg wrote: >> This PR proposes to add a new method `MemorySegment::maxByteAlignment` that >> returns the maximum byte alignment of a segment (both heap and native >> segments). >> >> Clients can then use this method to determine if a segment is

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v3]

2024-04-15 Thread Per Minborg
> This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly > aligned for any given layout (e.g. following a

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Maurizio Cimadamore
On Mon, 15 Apr 2024 13:17:26 GMT, Per Minborg wrote: >> test/jdk/java/foreign/TestMemoryAlignment.java line 154: >> >>> 152: Arena arena = Arena.ofConfined()) { >>> 153: var segment =channel.map(FileChannel.MapMode.READ_WRITE, >>> 0L, 32L, arena); >>> 154:

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Per Minborg
On Mon, 15 Apr 2024 10:16:30 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Update >> src/java.base/share/classes/jdk/internal/foreign/HeapMemorySegmentImpl.java >> >>

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Maurizio Cimadamore
On Mon, 15 Apr 2024 13:05:01 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 615: >> >>> 613: * the requested byte alignment during native segment allocation)} >>> 614: * >>> 615: * The returned alignment is always an even power

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Per Minborg
On Mon, 15 Apr 2024 10:07:31 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Update >> src/java.base/share/classes/jdk/internal/foreign/HeapMemorySegmentImpl.java >> >>

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Per Minborg
On Mon, 15 Apr 2024 10:05:44 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Update >> src/java.base/share/classes/jdk/internal/foreign/HeapMemorySegmentImpl.java >> >>

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Per Minborg
> This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly > aligned for any given layout (e.g. following a

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints

2024-04-15 Thread Jorn Vernee
On Mon, 15 Apr 2024 07:50:24 GMT, Per Minborg wrote: > This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly >

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints

2024-04-15 Thread Maurizio Cimadamore
On Mon, 15 Apr 2024 07:50:24 GMT, Per Minborg wrote: > This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly >

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints

2024-04-15 Thread Maurizio Cimadamore
On Mon, 15 Apr 2024 07:50:24 GMT, Per Minborg wrote: > This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly >

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints

2024-04-15 Thread Maurizio Cimadamore
On Mon, 15 Apr 2024 07:50:24 GMT, Per Minborg wrote: > This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segment is properly >