public interface HostMemoryAllocator
修饰符和类型 | 方法和描述 |
---|---|
HostMemoryBuffer |
allocate(long bytes)
分配内存,但务必关闭返回的缓冲区以避免内存泄漏。
|
HostMemoryBuffer |
allocate(long bytes, boolean preferPinned)
分配内存,但务必关闭返回的缓冲区以避免内存泄漏。
|
HostMemoryBuffer allocate(long bytes, boolean preferPinned)
bytes
- 要分配的字节大小preferPinned
- 如果设置为 true,将尽可能使用固定内存池,如果不可用则回退到堆外内存。如果设置为 false,则分配将始终来自堆外内存。HostMemoryBuffer allocate(long bytes)
bytes
- 要分配的字节大小版权所有 © 2025。保留所有权利。