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, 5404👍, 0💬
Popular Posts:
pache Derby is an open source relational database implemented entirely in Java and available under t...
How to download and install JDK (Java Development Kit) 8? If you want to write Java applications, yo...
What is jxl.jar 2.6.12? jxl.jar 2.6.12 is the JAR file for Java Excel API 2.6.12, which is a Java li...
Old version of xml-apis.jar. JAR File Size and Download Location: File name: xmlParserAPIs.jar File ...
Apache BCEL Source Code Files are inside the Apache BCEL source package file like bcel-6.6.1-src.zip...