Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 jdk.incubator.foreign.jmod - JDK Incubator Foreign
JDK 17 jdk.incubator.foreign.jmod is the JMOD file for JDK 17 HTTP Server module.
JDK 17 Incubator Foreign module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.incubator.foreign.jmod.
JDK 17 Incubator Foreign module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Incubator Foreign module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.incubator.foreign.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/foreign/ArenaAllocator.java
package jdk.internal.foreign; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.SegmentAllocator; import jdk.incubator.foreign.ResourceScope; public abstract class ArenaAllocator implements SegmentAllocator { protected MemorySegment segment; protected long sp = 0L; ArenaAllocator(MemorySegment segment) { this.segment = segment; } MemorySegment trySlice(long bytesSize, long bytesAlignment) { long min = segment.address().toRawLongValue(); long start = Utils.alignUp(min + sp, bytesAlignment) - min; if (segment.byteSize() - start < bytesSize) { return null; } else { MemorySegment slice = segment.asSlice(start, bytesSize); sp = start + bytesSize; return slice; } } void checkConfinementIfNeeded() { Thread ownerThread = scope().ownerThread(); if (ownerThread != null && ownerThread != Thread.currentThread()) { throw new IllegalStateException("Attempt to allocate outside confinement thread"); } } ResourceScope scope() { return segment.scope(); } public static class UnboundedArenaAllocator extends ArenaAllocator { private static final long DEFAULT_BLOCK_SIZE = 4 * 1024; public UnboundedArenaAllocator(ResourceScope scope) { super(MemorySegment.allocateNative(DEFAULT_BLOCK_SIZE, 1, scope)); } private MemorySegment newSegment(long size, long align) { return MemorySegment.allocateNative(size, align, segment.scope()); } @Override public MemorySegment allocate(long bytesSize, long bytesAlignment) { checkConfinementIfNeeded(); // try to slice from current segment first... MemorySegment slice = trySlice(bytesSize, bytesAlignment); if (slice != null) { return slice; } else { long maxPossibleAllocationSize = bytesSize + bytesAlignment - 1; if (maxPossibleAllocationSize > DEFAULT_BLOCK_SIZE) { // too big return newSegment(bytesSize, bytesAlignment); } else { // allocate a new segment and slice from there sp = 0L; segment = newSegment(DEFAULT_BLOCK_SIZE, 1L); return trySlice(bytesSize, bytesAlignment); } } } } public static class BoundedArenaAllocator extends ArenaAllocator { public BoundedArenaAllocator(ResourceScope scope, long size) { super(MemorySegment.allocateNative(size, 1, scope)); } @Override public MemorySegment allocate(long bytesSize, long bytesAlignment) { checkConfinementIfNeeded(); // try to slice from current segment first... MemorySegment slice = trySlice(bytesSize, bytesAlignment); if (slice != null) { return slice; } else { throw new OutOfMemoryError("Not enough space left to allocate"); } } } public static class BoundedSharedArenaAllocator extends BoundedArenaAllocator { public BoundedSharedArenaAllocator(ResourceScope scope, long size) { super(scope, size); } @Override public synchronized MemorySegment allocate(long bytesSize, long bytesAlignment) { return super.allocate(bytesSize, bytesAlignment); } } public static class UnboundedSharedArenaAllocator implements SegmentAllocator { final ResourceScope scope; final ThreadLocal<ArenaAllocator> allocators = new ThreadLocal<>() { @Override protected ArenaAllocator initialValue() { return new UnboundedArenaAllocator(scope); } }; public UnboundedSharedArenaAllocator(ResourceScope scope) { this.scope = scope; } @Override public MemorySegment allocate(long bytesSize, long bytesAlignment) { return allocators.get().allocate(bytesSize, bytesAlignment); } } }
⏎ jdk/internal/foreign/ArenaAllocator.java
Or download all of them as a single archive file:
File name: jdk.incubator.foreign-17.0.5-src.zip File size: 168767 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.incubator.vector.jmod - JDK Incubator Vector
2023-10-04, 3911👍, 0💬
Popular Posts:
Apache Commons Lang 3 is the 3rd version of Apache Commons Lang, which provides a host of helper uti...
What is the sax\Counter.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 inst...
JDK 11 jdk.localedata.jmod is the JMOD file for JDK 11 Localedata module. JDK 11 Locale Data module ...
What Is poi-5.2.3.jar? poi-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which provides an...
JDK 11 java.naming.jmod is the JMOD file for JDK 11 Naming module. JDK 11 Naming module compiled cla...