Allocator for page-aligned host memory. More...
#include <bounce_buffer.hpp>
Public Member Functions | |
| void * | allocate (std::size_t size) |
| Allocate page-aligned host memory. More... | |
| void | deallocate (void *buffer, std::size_t size) |
| Deallocate memory previously allocated by this allocator. More... | |
Allocator for page-aligned host memory.
Uses std::aligned_alloc to allocate host memory aligned to page boundaries (typically 4096 bytes). This allocator is suitable for Direct I/O operations that require page-aligned buffers but do not need CUDA context (i.e., host-to-host transfers only).
Definition at line 20 of file bounce_buffer.hpp.
| void* kvikio::PageAlignedAllocator::allocate | ( | std::size_t | size | ) |
Allocate page-aligned host memory.
| size | Requested size in bytes (will be rounded up to page boundary) |
| void kvikio::PageAlignedAllocator::deallocate | ( | void * | buffer, |
| std::size_t | size | ||
| ) |
Deallocate memory previously allocated by this allocator.
| buffer | Pointer to memory to deallocate |
| size | Size of the allocation (unused, for interface consistency) |