APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.foreign

pack-priv non-sealed Class GlobalSession

extends MemorySessionImpl
Class Inheritance
Known Direct Subclasses
jdk.internal.foreign.GlobalSession.HeapSession
Imports
jdk.internal.vm.annotation.ForceInline, java.util.Objects

The global, non-closeable, shared session. Similar to a shared session, but its close() method throws unconditionally. Adding new resources to the global session, does nothing: as the session can never become not-alive, there is nothing to track. Acquiring and or releasing a memory session similarly does nothing.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
GlobalSession.HeapSession

This is a global session that wraps a heap object.

Field Summary

Inherited from jdk.internal.foreign.MemorySessionImpl:
ACQUIRE_COUNTacquireCountALREADY_CLOSEDCLOSEDGLOBAL_SESSIONMAX_FORKSNONCLOSEABLEOPENownerresourceListSTATEstateWRONG_THREAD

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
pack-priv void
public void
public void
Inherited from jdk.internal.foreign.MemorySessionImpl:
addCloseActionaddOrCleanupIfFailalreadyAcquiredalreadyClosedasArenacheckValidStatecheckValidStatecheckValidStateRawcloneclosecreateConfinedcreateHeapcreateImplicitcreateSharedisAccessibleByisAliveisCloseableisCloseableBynonCloseableownerThreadtoMemorySessiontooManyAcquireswhileAlivewrongThread

Constructor Detail

GlobalSessionback to summary
public GlobalSession()

Method Detail

acquire0back to summary
public void acquire0()

Implements abstract jdk.internal.foreign.MemorySessionImpl.acquire0.

Annotations
@Override
@ForceInline
addInternalback to summary
pack-priv void addInternal(MemorySessionImpl.ResourceList.ResourceCleanup resource)

Overrides jdk.internal.foreign.MemorySessionImpl.addInternal.

Annotations
@Override
justCloseback to summary
public void justClose()

Implements abstract jdk.internal.foreign.MemorySessionImpl.justClose.

Annotations
@Override
release0back to summary
public void release0()

Implements abstract jdk.internal.foreign.MemorySessionImpl.release0.

Annotations
@Override
@ForceInline
jdk.internal.foreign back to summary

pack-priv Class GlobalSession.HeapSession

extends GlobalSession
Class Inheritance

This is a global session that wraps a heap object. Possible objects are: Java arrays, buffers and class loaders. Objects of two heap sessions are compared by identity. That is, if the wrapped object is the same, then the resulting heap sessions are also considered equals. We do not compare the objects using Object#equals(Object), as that would be problematic when comparing buffers, whose equality and hash codes are content-dependent.

Field Summary

Modifier and TypeField and Description
pack-priv final Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Implements java.lang.foreign.MemorySegment.Scope.equals.

Returns true, if the provided object is also a scope, which models the same lifetime as that modeled by this scope.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.lang.foreign.MemorySegment.Scope.hashCode.

Returns the hash code of this scope object.

Inherited from jdk.internal.foreign.GlobalSession:
acquire0addInternaljustCloserelease0

Field Detail

refback to summary
pack-priv final Object ref

Constructor Detail

HeapSessionback to summary
public HeapSession(Object ref)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Implements java.lang.foreign.MemorySegment.Scope.equals.

Doc from java.lang.foreign.MemorySegment.Scope.equals.

Returns true, if the provided object is also a scope, which models the same lifetime as that modeled by this scope. . In that case, it is always the case that this.isAlive() == ((Scope)that).isAlive().

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.lang.foreign.MemorySegment.Scope.hashCode.

Doc from java.lang.foreign.MemorySegment.Scope.hashCode.

Returns the hash code of this scope object.

Annotations
@Override