<!--
{
  "documentType" : "article",
  "framework" : "Hypervisor",
  "identifier" : "/documentation/Hypervisor/intel-based_mac-memory-management",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Memory Management"
}
-->

# Memory Management

Map memory into the physical address space of the virtual machine, and allocate additional memory for the current task.

## Topics

### Shared memory

[`func hv_vm_map(UnsafeMutableRawPointer, hv_ipa_t, Int, hv_memory_flags_t) -> hv_return_t`](/documentation/Hypervisor/hv_vm_map(_:_:_:_:))

Maps a region in the virtual address space of the current process into the guest physical address space of the VM.

[`func hv_vm_unmap(hv_ipa_t, Int) -> hv_return_t`](/documentation/Hypervisor/hv_vm_unmap(_:_:))

Unmaps a region in the guest physical address space of the VM.

[`func hv_vm_protect(hv_ipa_t, Int, hv_memory_flags_t) -> hv_return_t`](/documentation/Hypervisor/hv_vm_protect(_:_:_:))

Modifies the permissions of a region in the guest physical address space of the VM.

### Process-specific memory

[`func hv_vm_space_create(UnsafeMutablePointer<hv_vm_space_t>) -> hv_return_t`](/documentation/Hypervisor/hv_vm_space_create(_:))

Creates an additional guest address space for the current task.

[`func hv_vm_space_destroy(hv_vm_space_t) -> hv_return_t`](/documentation/Hypervisor/hv_vm_space_destroy(_:))

Destroys the address space instance associated with the current task.

[`func hv_vm_map_space(hv_vm_space_t, hv_uvaddr_t, hv_gpaddr_t, Int, hv_memory_flags_t) -> hv_return_t`](/documentation/Hypervisor/hv_vm_map_space(_:_:_:_:_:))

Maps a region in the virtual address space of the current task into a guest physical address space of the VM.

[`func hv_vm_unmap_space(hv_vm_space_t, hv_gpaddr_t, Int) -> hv_return_t`](/documentation/Hypervisor/hv_vm_unmap_space(_:_:_:))

Umaps a region in a guest physical address space of the VM.

[`func hv_vm_protect_space(hv_vm_space_t, hv_gpaddr_t, Int, hv_memory_flags_t) -> hv_return_t`](/documentation/Hypervisor/hv_vm_protect_space(_:_:_:_:))

Modifies the permissions of a region in a guest physical address space of the VM.

### Common types

[`typealias hv_uvaddr_t`](/documentation/Hypervisor/hv_uvaddr_t)

The type of a user virtual address.

[`typealias hv_gpaddr_t`](/documentation/Hypervisor/hv_gpaddr_t)

The type of a guest physical address (GPA).

[`typealias hv_memory_flags_t`](/documentation/Hypervisor/hv_memory_flags_t)

The permissions for guest physical memory regions.

[Memory Permissions](/documentation/Hypervisor/1447309-memory_permissions-enum)

Enumeration values that describe memory permissions.

[`typealias hv_vm_space_t`](/documentation/Hypervisor/hv_vm_space_t)

The type of a guest-address space.

[Address Space Types](/documentation/Hypervisor/3181561-address_space_type-enum)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)