#include <Hypervisor/hv_vm_allocate.h> also included by <Hypervisor/Hypervisor.h>

hv_vm_allocate.h

2 functions · 1 enum · 1 typedef

enum(anonymous)

@abstract Memory allocation flags
underlying type unsigned int
HV_ALLOCATE_DEFAULT0

typedefhv_allocate_flags_t

typedef uint64_t hv_allocate_flags_t

functionhv_vm_allocate

OS_EXPORT HV_API_AVAILABLE_ARM64(macos(12.1)) HV_API_AVAILABLE_X86_64(macos(12.0)) hv_return_t hv_vm_allocate(
	void * _Nullable * _Nonnull uvap,
	size_t size,
	hv_allocate_flags_t flags
)
@abstract Allocate anonymous memory suitable to be mapped as guest memory @param uvap Returned virtual address of the allocated memory @param size Size in bytes of the region to be allocated @param flags Memory allocation flags @result 0 on success or error code @discussion The memory is allocated with VM_PROT_DEFAULT permissions This API enables accurate memory accounting of the allocations it creates Size must be a multiple of PAGE_SIZE Memory returned by this API should be deallocated with hv_vm_deallocate

functionhv_vm_deallocate

OS_EXPORT HV_API_AVAILABLE_ARM64(macos(12.1)) HV_API_AVAILABLE_X86_64(macos(12.0)) hv_return_t hv_vm_deallocate(
	void *uva,
	size_t size
)
@abstract Deallocate memory previously allocated by hv_vm_allocate @param uva Virtual address of the allocated memory @param size Size in bytes of the region to be deallocated @result 0 on success or error code