Package io.netty.util.internal
Class CleanerJava24Linker
- java.lang.Object
-
- io.netty.util.internal.CleanerJava24Linker
-
public class CleanerJava24Linker extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CleanerJava24Linker()
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description CleanableDirectBufferallocate(int capacity)voidfreeDirectBuffer(java.nio.ByteBuffer buffer)booleanhasExpensiveClean()default CleanableDirectBufferreallocate(CleanableDirectBuffer old, int newCapacity)Reallocate a direct buffer with a new capacity.
-
-
-
Method Detail
-
allocate
public CleanableDirectBuffer allocate(int capacity)
-
freeDirectBuffer
public void freeDirectBuffer(java.nio.ByteBuffer buffer)
-
hasExpensiveClean
public boolean hasExpensiveClean()
-
reallocate
public default CleanableDirectBuffer reallocate(CleanableDirectBuffer old, int newCapacity)
Reallocate a direct buffer with a new capacity. The old buffer is consumed and must not be used after this call.The default implementation allocates a new buffer, copies the data, and frees the old one. Implementations may override this to provide more efficient reallocation (e.g. via
Unsafe.reallocateMemory).
-
-