public static final class HybridMemorySegment.HybridMemorySegmentFactory extends Object implements MemorySegmentFactory.Factory
| Modifier and Type | Method and Description |
|---|---|
HybridMemorySegment |
allocateUnpooledSegment(int size,
Object owner)
Allocates some unpooled memory and creates a new memory segment that represents
that memory.
|
HybridMemorySegment |
wrap(byte[] memory)
Creates a new memory segment that targets the given heap memory region.
|
HybridMemorySegment |
wrapPooledHeapMemory(byte[] memory,
Object owner)
Creates a memory segment that wraps the given byte array.
|
HybridMemorySegment |
wrapPooledOffHeapMemory(ByteBuffer memory,
Object owner)
Creates a memory segment that wraps the off-heap memory backing the given ByteBuffer.
|
public HybridMemorySegment wrap(byte[] memory)
MemorySegmentFactory.Factorywrap in interface MemorySegmentFactory.Factorymemory - The heap memory region.public HybridMemorySegment allocateUnpooledSegment(int size, Object owner)
MemorySegmentFactory.FactoryallocateUnpooledSegment in interface MemorySegmentFactory.Factorysize - The size of the memory segment to allocate.owner - The owner to associate with the memory segment.public HybridMemorySegment wrapPooledHeapMemory(byte[] memory, Object owner)
MemorySegmentFactory.FactoryThis method is intended to be used for components which pool memory and create memory segments around long-lived memory regions.
wrapPooledHeapMemory in interface MemorySegmentFactory.Factorymemory - The heap memory to be represented by the memory segment.owner - The owner to associate with the memory segment.public HybridMemorySegment wrapPooledOffHeapMemory(ByteBuffer memory, Object owner)
MemorySegmentFactory.FactoryThis method is intended to be used for components which pool memory and create memory segments around long-lived memory regions.
wrapPooledOffHeapMemory in interface MemorySegmentFactory.Factorymemory - The byte buffer with the off-heap memory to be represented by the memory segment.owner - The owner to associate with the memory segment.Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.