public class DefaultHostMemoryAllocator extends Object implements HostMemoryAllocator
| Constructor and Description |
|---|
DefaultHostMemoryAllocator() |
| Modifier and Type | Method and Description |
|---|---|
HostMemoryBuffer |
allocate(long bytes)
Allocate memory, but be sure to close the returned buffer to avoid memory leaks.
|
HostMemoryBuffer |
allocate(long bytes,
boolean preferPinned)
Allocate memory, but be sure to close the returned buffer to avoid memory leaks.
|
static HostMemoryAllocator |
get()
Retrieve current host memory allocator used by default if not passed directly to API
|
static void |
set(HostMemoryAllocator hostMemoryAllocator)
Sets a new default host memory allocator implementation by default.
|
public static HostMemoryAllocator get()
public static void set(HostMemoryAllocator hostMemoryAllocator)
hostMemoryAllocator - public HostMemoryBuffer allocate(long bytes, boolean preferPinned)
HostMemoryAllocatorallocate in interface HostMemoryAllocatorbytes - size in bytes to allocatepreferPinned - If set to true, the pinned memory pool will be used if possible with a
fallback to off-heap memory. If set to false, the allocation will always
be from off-heap memory.public HostMemoryBuffer allocate(long bytes)
HostMemoryAllocatorallocate in interface HostMemoryAllocatorbytes - size in bytes to allocateCopyright © 2024. All rights reserved.