public static final class HeapMemorySegment.HeapMemorySegmentFactory extends Object implements MemorySegmentFactory.Factory
| Modifier and Type | Method and Description |
|---|---|
HeapMemorySegment |
allocateUnpooledSegment(int size,
Object owner)
Allocates some unpooled memory and creates a new memory segment that represents
that memory.
|
HeapMemorySegment |
wrap(byte[] memory)
Creates a new memory segment that targets the given heap memory region.
|
HeapMemorySegment |
wrapPooledHeapMemory(byte[] memory,
Object owner)
Creates a memory segment that wraps the given byte array.
|
HeapMemorySegment |
wrapPooledOffHeapMemory(ByteBuffer memory,
Object owner)
Creates a memory segment that wraps the off-heap memory backing the given ByteBuffer.
|
public HeapMemorySegment wrap(byte[] memory)
MemorySegmentFactory.Factorywrap in interface MemorySegmentFactory.Factorymemory - The heap memory region.public HeapMemorySegment 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 HeapMemorySegment 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 HeapMemorySegment 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.