Function allocatePool [src]
Allocates a memory region of size bytes from memory of type pool_type
and returns the allocated memory. Allocates pages from .conventional_memory
as needed to grow the requested pool type.
Prototype
pub fn allocatePool( self: *BootServices, pool_type: MemoryType, size: usize, ) AllocatePoolError![]align(8) u8 Parameters
self: *BootServicespool_type: MemoryTypesize: usize Possible Errors
Source
pub fn allocatePool(
self: *BootServices,
pool_type: MemoryType,
size: usize,
) AllocatePoolError![]align(8) u8 {
var ptr: [*]align(8) u8 = undefined;
switch (self._allocatePool(pool_type, size, &ptr)) {
.success => return ptr[0..size],
.out_of_resources => return error.OutOfResources,
.invalid_parameter => return error.InvalidParameter,
else => |status| return uefi.unexpectedStatus(status),
}
}