#include <mach/mach_vm.h>

mach/mach_vm.h Kernel.framework

Module mach_vm
includes: Kernel/string.h, Kernel/mach/ndr.h, Kernel/mach/boolean.h, Kernel/mach/kern_return.h, Kernel/mach/notify.h, mach/mach_types.h, mach/message.h, Kernel/mach/mig_errors.h, mach/port.h, Availability.h, Kernel/mach/std_types.h, Kernel/mach/mig.h, Kernel/mach/mig.h, mach/mach_types.h, Kernel/mach_debug/mach_debug_types.h, sys/cdefs.h
4 functions · 1 macro

functionmach_vm_deferred_reclamation_buffer_allocate

extern kern_return_t mach_vm_deferred_reclamation_buffer_allocate(
	task_t target_task,
	mach_vm_address_t *address, /* out */
	uint64_t *next_deadline, /* out */
	uint32_t len,
	uint32_t max_len
)
Mach VM deferred reclamation subsystem
MIG routine from mach/mach_vm.defs

functionmach_vm_deferred_reclamation_buffer_flush

extern kern_return_t mach_vm_deferred_reclamation_buffer_flush(
	task_t target_task,
	uint32_t num_entries_to_reclaim,
	uint64_t *bytes_reclaimed, /* out */
	uint64_t *next_deadline /* out */
)
MIG routine from mach/mach_vm.defs
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_user.c, osfmk/vm/vm_reclaim.c
Reclaims up to num_entries_to_reclaim entries from the target task's deferred-reclamation ring buffer, freeing the virtual memory they describe; the number of bytes actually reclaimed is returned through bytes_reclaimed. Remote operation is not supported: the task must be the current task or KERN_INVALID_TASK is returned. Returns KERN_NOT_SUPPORTED on kernels built without CONFIG_DEFERRED_RECLAIM.

functionmach_vm_deferred_reclamation_buffer_resize

extern kern_return_t mach_vm_deferred_reclamation_buffer_resize(
	task_t target_task,
	uint32_t new_len,
	uint64_t *bytes_reclaimed, /* out */
	uint64_t *next_deadline /* out */
)
MIG routine from mach/mach_vm.defs
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_user.c, osfmk/vm/vm_reclaim.c
Resizes the target task's deferred-reclamation ring buffer to hold new_len entries, reclaiming buffered entries as needed; the number of bytes reclaimed in the process is returned through bytes_reclaimed. The task must be the current task (KERN_INVALID_TASK otherwise). Returns KERN_NOT_SUPPORTED on kernels built without CONFIG_DEFERRED_RECLAIM.

functionmach_vm_deferred_reclamation_buffer_query

extern kern_return_t mach_vm_deferred_reclamation_buffer_query(
	task_read_t target,
	mach_vm_address_t *addr, /* out */
	mach_vm_size_t *size /* out */
)
MIG routine from mach/mach_vm.defs
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_user.c, osfmk/vm/vm_reclaim.c
Returns the address and size of the target task's deferred-reclamation ring buffer. Returns KERN_NOT_SUPPORTED on kernels built without CONFIG_DEFERRED_RECLAIM.

macrosubsystem_to_name_map_mach_vm

#define subsystem_to_name_map_mach_vm { "mach_vm_allocate", 4800 },
    { "mach_vm_deallocate", 4801 },
    { "mach_vm_protect", 4802 },
    { "mach_vm_inherit", 4803 },
    { "mach_vm_read", 4804 },
    { "mach_vm_read_list", 4805 },
    { "mach_vm_write", 4806 },
    { "mach_vm_copy", 4807 },
    { "mach_vm_read_overwrite", 4808 },
    { "mach_vm_msync", 4809 },
    { "mach_vm_behavior_set", 4810 },
    { "mach_vm_map", 4811 },
    { "mach_vm_machine_attribute", 4812 },
    { "mach_vm_remap", 4813 },
    { "mach_vm_page_query", 4814 },
    { "mach_vm_region_recurse", 4815 },
    { "mach_vm_region", 4816 },
    { "_mach_make_memory_entry", 4817 },
    { "mach_vm_purgable_control", 4818 },
    { "mach_vm_page_info", 4819 },
    { "mach_vm_page_range_query", 4820 },
    { "mach_vm_remap_new", 4821 },
    { "mach_vm_deferred_reclamation_buffer_allocate", 4822 },
    { "mach_vm_deferred_reclamation_buffer_flush", 4823 },
    { "mach_vm_range_create", 4825 },
    { "mach_vm_deferred_reclamation_buffer_resize", 4826 },
    { "mach_vm_update_pointers_with_remote_tags", 4827 },
    { "mach_vm_deferred_reclamation_buffer_query", 4828 },
    { "mach_vm_reallocate", 4829 }