[foreign-memaccess+abi] RFR: MemorySegmentPool + Allocator [v11]

Radoslaw Smogura github.com+7535718+rsmogura at openjdk.java.net
Sat Apr 24 01:25:56 UTC 2021


> (Preview)
> 
> The MemorySegmentPool is a pool maintaining memory segments, optionally can expose allocator which can be bound to other scope, and which will return allocated segments back to pool.
> 
> However the best results has been achieved by using getSegmentEntry & putSegmentEntry methods.
> 
> The pool is intended to be used by long running applications (i.e. like global shared pool), where fast allocation and de-allocation of segments is critical (was designed during implementation of I/O subsystem with Panama, as a pool for temporary buffers between system I/O methods and Java byte arrays from InputStreams).
> 
> The pool uses hand-made SpinLockQueue as the Deque from JDK offers too much functionality and overhead.

Radoslaw Smogura has updated the pull request incrementally with one additional commit since the last revision:

  Adjust to latest changes
  Remove direct API
  Prevent keeping hard reference to shared scope, through chain cleaner, pooled allocator, pool scope

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

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/509/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/509/files/2d0cb6c6..32e307b6

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=509&range=10
 - incr: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=509&range=09-10

  Stats: 81 lines in 3 files changed: 31 ins; 42 del; 8 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/509.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/509/head:pull/509

PR: https://git.openjdk.java.net/panama-foreign/pull/509


More information about the panama-dev mailing list