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/NativeMemorySegmentImpl.java
/* * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * * */ package jdk.internal.foreign; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; import jdk.internal.misc.Unsafe; import jdk.internal.misc.VM; import jdk.internal.vm.annotation.ForceInline; import sun.security.action.GetBooleanAction; import java.nio.ByteBuffer; /** * Implementation for native memory segments. A native memory segment is essentially a wrapper around * a native long address. */ public class NativeMemorySegmentImpl extends AbstractMemorySegmentImpl { public static final MemorySegment EVERYTHING = makeNativeSegmentUnchecked(MemoryAddress.NULL, Long.MAX_VALUE, null, ResourceScopeImpl.GLOBAL); private static final Unsafe unsafe = Unsafe.getUnsafe(); public static final SegmentAllocator IMPLICIT_ALLOCATOR = (size, align) -> MemorySegment.allocateNative(size, align, ResourceScope.newImplicitScope()); // The maximum alignment supported by malloc - typically 16 on // 64-bit platforms and 8 on 32-bit platforms. private static final long MAX_MALLOC_ALIGN = Unsafe.ADDRESS_SIZE == 4 ? 8 : 16; private static final boolean skipZeroMemory = GetBooleanAction.privilegedGetProperty("jdk.internal.foreign.skipZeroMemory"); final long min; @ForceInline NativeMemorySegmentImpl(long min, long length, int mask, ResourceScopeImpl scope) { super(length, mask, scope); this.min = min; } @Override NativeMemorySegmentImpl dup(long offset, long size, int mask, ResourceScopeImpl scope) { return new NativeMemorySegmentImpl(min + offset, size, mask, scope); } @Override ByteBuffer makeByteBuffer() { return nioAccess.newDirectByteBuffer(min(), (int) this.length, null, scope == ResourceScopeImpl.GLOBAL ? null : this); } @Override public boolean isNative() { return true; } @Override long min() { return min; } @Override Object base() { return null; } // factories public static MemorySegment makeNativeSegment(long bytesSize, long alignmentBytes, ResourceScopeImpl scope) { scope.checkValidStateSlow(); if (VM.isDirectMemoryPageAligned()) { alignmentBytes = Math.max(alignmentBytes, nioAccess.pageSize()); } long alignedSize = alignmentBytes > MAX_MALLOC_ALIGN ? bytesSize + (alignmentBytes - 1) : bytesSize; nioAccess.reserveMemory(alignedSize, bytesSize); long buf = unsafe.allocateMemory(alignedSize); if (!skipZeroMemory) { unsafe.setMemory(buf, alignedSize, (byte)0); } long alignedBuf = Utils.alignUp(buf, alignmentBytes); AbstractMemorySegmentImpl segment = new NativeMemorySegmentImpl(buf, alignedSize, defaultAccessModes(alignedSize), scope); scope.addOrCleanupIfFail(new ResourceScopeImpl.ResourceList.ResourceCleanup() { @Override public void cleanup() { unsafe.freeMemory(buf); nioAccess.unreserveMemory(alignedSize, bytesSize); } }); if (alignedSize != bytesSize) { long delta = alignedBuf - buf; segment = segment.asSlice(delta, bytesSize); } return segment; } public static MemorySegment makeNativeSegmentUnchecked(MemoryAddress min, long bytesSize, Runnable cleanupAction, ResourceScopeImpl scope) { scope.checkValidStateSlow(); AbstractMemorySegmentImpl segment = new NativeMemorySegmentImpl(min.toRawLongValue(), bytesSize, defaultAccessModes(bytesSize), scope); if (cleanupAction != null) { scope.addCloseAction(cleanupAction); } return segment; } }
⏎ jdk/internal/foreign/NativeMemorySegmentImpl.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, 3892👍, 0💬
Popular Posts:
Apache Neethi provides general framework for the programmers to use WS Policy. It is compliant with ...
What Is HttpComponents httpcore-4.2.2.jar? HttpComponents httpcore-4.2.2.jar is the JAR file for Apa...
Java Cryptography Extension 1.2.2 JAR File Size and Download Location: File name: jce.jar, jce-1.2.2...
What Is junit-3.8.1.jar? junit-3.8.1.jar is the version 3.8.1 of JUnit JAR library file. JUnit is a ...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...