#include <mach/vm_region.h> also included by <mach/mach.h>

mach/vm_region.h

File: mach/vm_region.h Define the attributes of a task's memory region
32 macros · 28 typedefs · 10 structs

typedefvm32_object_id_t

LP64todo: all the current tools are 32bit, obviously never worked for 64b so probably should be a real 32b ID vs. ptr. Current users just check for equality
typedef uint32_t vm32_object_id_t

macroVM_REGION_INFO_MAX

#define VM_REGION_INFO_MAX (1024)

typedefvm_region_info_t

typedef int *vm_region_info_t

typedefvm_region_info_64_t

typedef int *vm_region_info_64_t

typedefvm_region_recurse_info_t

typedef int *vm_region_recurse_info_t

typedefvm_region_recurse_info_64_t

typedef int *vm_region_recurse_info_64_t

typedefvm_region_flavor_t

typedef int vm_region_flavor_t
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Defined values:
VM_REGION_BASIC_INFOBasic information about the region (size, inheritance, etc.). This information is declared by the vm_region_basic_info structure.

typedefvm_region_info_data_t

typedef int vm_region_info_data_t[VM_REGION_INFO_MAX]

macroVM_REGION_BASIC_INFO_64

#define VM_REGION_BASIC_INFO_64 9

structvm_region_basic_info_64

size 36, align 4
vm_prot_tprotection
vm_prot_tmax_protection
vm_inherit_tinheritance
boolean_tshared
boolean_treserved
memory_object_offset_toffset
vm_behavior_tbehavior
unsigned shortuser_wired_count

typedefvm_region_basic_info_64_t

typedef struct vm_region_basic_info_64 *vm_region_basic_info_64_t

typedefvm_region_basic_info_data_64_t

typedef struct vm_region_basic_info_64 vm_region_basic_info_data_64_t

macroVM_REGION_BASIC_INFO_COUNT_64

#define VM_REGION_BASIC_INFO_COUNT_64 ((mach_msg_type_number_t)
	(sizeof(vm_region_basic_info_data_64_t)/sizeof(int)))

macroVM_REGION_BASIC_INFO

Passing VM_REGION_BASIC_INFO to vm_region_64 automatically converts it to a VM_REGION_BASIC_INFO_64. Please use that explicitly instead.
#define VM_REGION_BASIC_INFO 10
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Basic information about the region (size, inheritance, etc.). This information is declared by the vm_region_basic_info structure.

structvm_region_basic_info

This is the legacy basic info structure. It is deprecated because it passes only a 32-bit memory object offset back - too small for many larger objects (e.g. files).
size 32, align 4
vm_prot_tprotection
vm_prot_tmax_protection
vm_inherit_tinheritance
boolean_tshared
boolean_treserved
uint32_toffsettoo small for a real offset
vm_behavior_tbehavior
unsigned shortuser_wired_count
CMU/MIT Mach reference · manual page · © Carnegie Mellon
Defines the attributes of a task's memory region.
The vm_region_basic_info structure defines the attributes of a memory region returned by vm_region.

typedefvm_region_basic_info_t

typedef struct vm_region_basic_info *vm_region_basic_info_t

typedefvm_region_basic_info_data_t

typedef struct vm_region_basic_info vm_region_basic_info_data_t

macroVM_REGION_BASIC_INFO_COUNT

#define VM_REGION_BASIC_INFO_COUNT ((mach_msg_type_number_t)
	(sizeof(vm_region_basic_info_data_t)/sizeof(int)))

macroSM_COW

Clients should move away from using these codes for anything other than debugging or best-effort accounting. Each value is only loosely defined, and even within those definitions it is not always possible for the VM to return the correct value. This behavior is also subject to change as VM internals evolve.
#define SM_COW 1

macroSM_PRIVATE

#define SM_PRIVATE 2

macroSM_EMPTY

#define SM_EMPTY 3

macroSM_SHARED

#define SM_SHARED 4

macroSM_TRUESHARED

#define SM_TRUESHARED 5

macroSM_PRIVATE_ALIASED

#define SM_PRIVATE_ALIASED 6

macroSM_SHARED_ALIASED

#define SM_SHARED_ALIASED 7

macroSM_LARGE_PAGE

#define SM_LARGE_PAGE 8

macroVM_REGION_EXTENDED_INFO

#define VM_REGION_EXTENDED_INFO 13

structvm_region_extended_info

size 36, align 4
vm_prot_tprotection
unsigned intuser_tag
unsigned intpages_resident
unsigned intpages_shared_now_private
unsigned intpages_swapped_out
unsigned intpages_dirtied
unsigned intref_count
unsigned shortshadow_depth
unsigned charexternal_pager
unsigned charshare_mode
unsigned intpages_reusable

typedefvm_region_extended_info_t

typedef struct vm_region_extended_info *vm_region_extended_info_t

typedefvm_region_extended_info_data_t

typedef struct vm_region_extended_info vm_region_extended_info_data_t

macroVM_REGION_EXTENDED_INFO_COUNT

#define VM_REGION_EXTENDED_INFO_COUNT ((mach_msg_type_number_t)
	 (sizeof (vm_region_extended_info_data_t) / sizeof (natural_t)))

macroVM_REGION_TOP_INFO

#define VM_REGION_TOP_INFO 12

structvm_region_top_info

size 20, align 4
unsigned intobj_id
unsigned intref_count
unsigned intprivate_pages_resident
unsigned intshared_pages_resident
unsigned charshare_mode

typedefvm_region_top_info_t

typedef struct vm_region_top_info *vm_region_top_info_t

typedefvm_region_top_info_data_t

typedef struct vm_region_top_info vm_region_top_info_data_t

macroVM_REGION_TOP_INFO_COUNT

#define VM_REGION_TOP_INFO_COUNT ((mach_msg_type_number_t)
	 (sizeof(vm_region_top_info_data_t) / sizeof(natural_t)))

structvm_region_submap_info

size 60, align 4
vm_prot_tprotectionpresent access protection
vm_prot_tmax_protectionmax avail through vm_prot
vm_inherit_tinheritancebehavior of map/obj on fork
uint32_toffsetoffset into object/map
unsigned intuser_taguser tag on map entry
unsigned intpages_residentonly valid for objects
unsigned intpages_shared_now_privateonly for objects
unsigned intpages_swapped_outonly for objects
unsigned intpages_dirtiedonly for objects
unsigned intref_countobj/map mappers, etc
unsigned shortshadow_depthonly for obj
unsigned charexternal_pageronly for obj
unsigned charshare_modesee enumeration
boolean_tis_submapsubmap vs obj
vm_behavior_tbehavioraccess behavior hint
vm32_object_id_tobject_idobj/map name, not a handle
unsigned shortuser_wired_count

typedefvm_region_submap_info_t

typedef struct vm_region_submap_info *vm_region_submap_info_t

typedefvm_region_submap_info_data_t

typedef struct vm_region_submap_info vm_region_submap_info_data_t

macroVM_REGION_SUBMAP_INFO_COUNT

#define VM_REGION_SUBMAP_INFO_COUNT ((mach_msg_type_number_t)
	 (sizeof(vm_region_submap_info_data_t) / sizeof(natural_t)))

structvm_region_submap_info_64

size 76, align 4
vm_prot_tprotectionv0 fields present access protection
vm_prot_tmax_protectionmax avail through vm_prot
vm_inherit_tinheritancebehavior of map/obj on fork
memory_object_offset_toffsetoffset into object/map
unsigned intuser_taguser tag on map entry
unsigned intpages_residentonly valid for objects
unsigned intpages_shared_now_privateonly for objects
unsigned intpages_swapped_outonly for objects
unsigned intpages_dirtiedonly for objects
unsigned intref_countobj/map mappers, etc
unsigned shortshadow_depthonly for obj
unsigned charexternal_pageronly for obj
unsigned charshare_modesee enumeration
boolean_tis_submapsubmap vs obj
vm_behavior_tbehavioraccess behavior hint
vm32_object_id_tobject_idobj/map name, not a handle
unsigned shortuser_wired_count
unsigned shortflags
unsigned intpages_reusablev1 fields
vm_object_id_tobject_id_fullv2 fields

typedefvm_region_submap_info_64_t

typedef struct vm_region_submap_info_64 *vm_region_submap_info_64_t

typedefvm_region_submap_info_data_64_t

typedef struct vm_region_submap_info_64 vm_region_submap_info_data_64_t

macroVM_REGION_SUBMAP_INFO_V2_SIZE

Note that this size is hard-coded at the MIG boundary in mach_types.defs so if we ever increase this you'll need to also bump the definition of vm_region_recurse_info_t.
#define VM_REGION_SUBMAP_INFO_V2_SIZE (sizeof (vm_region_submap_info_data_64_t))

macroVM_REGION_SUBMAP_INFO_V1_SIZE

v1 size is v2 size minus v2's new fields
#define VM_REGION_SUBMAP_INFO_V1_SIZE (VM_REGION_SUBMAP_INFO_V2_SIZE -
	 sizeof (vm_object_id_t) /* object_id_full */ )

macroVM_REGION_SUBMAP_INFO_V0_SIZE

v0 size is v1 size minus v1's new fields
#define VM_REGION_SUBMAP_INFO_V0_SIZE (VM_REGION_SUBMAP_INFO_V1_SIZE -
	 sizeof (unsigned int) /* pages_reusable */ )

macroVM_REGION_SUBMAP_INFO_V2_COUNT_64

#define VM_REGION_SUBMAP_INFO_V2_COUNT_64 ((mach_msg_type_number_t)
	 (VM_REGION_SUBMAP_INFO_V2_SIZE / sizeof (natural_t)))

macroVM_REGION_SUBMAP_INFO_V1_COUNT_64

#define VM_REGION_SUBMAP_INFO_V1_COUNT_64 ((mach_msg_type_number_t)
	 (VM_REGION_SUBMAP_INFO_V1_SIZE / sizeof (natural_t)))

macroVM_REGION_SUBMAP_INFO_V0_COUNT_64

#define VM_REGION_SUBMAP_INFO_V0_COUNT_64 ((mach_msg_type_number_t)
	 (VM_REGION_SUBMAP_INFO_V0_SIZE / sizeof (natural_t)))

macroVM_REGION_SUBMAP_INFO_COUNT_64

set this to the latest version
#define VM_REGION_SUBMAP_INFO_COUNT_64 VM_REGION_SUBMAP_INFO_V2_COUNT_64

macroVM_REGION_FLAG_JIT_ENABLED

#define VM_REGION_FLAG_JIT_ENABLED 0x1

macroVM_REGION_FLAG_TPRO_ENABLED

#define VM_REGION_FLAG_TPRO_ENABLED 0x2

structvm_region_submap_short_info_64

size 48, align 4
vm_prot_tprotectionpresent access protection
vm_prot_tmax_protectionmax avail through vm_prot
vm_inherit_tinheritancebehavior of map/obj on fork
memory_object_offset_toffsetoffset into object/map
unsigned intuser_taguser tag on map entry
unsigned intref_countobj/map mappers, etc
unsigned shortshadow_depthonly for obj
unsigned charexternal_pageronly for obj
unsigned charshare_modesee enumeration
boolean_tis_submapsubmap vs obj
vm_behavior_tbehavioraccess behavior hint
vm32_object_id_tobject_idobj/map name, not a handle
unsigned shortuser_wired_count
unsigned shortflags

typedefvm_region_submap_short_info_64_t

typedef struct vm_region_submap_short_info_64 *vm_region_submap_short_info_64_t

typedefvm_region_submap_short_info_data_64_t

typedef struct vm_region_submap_short_info_64 vm_region_submap_short_info_data_64_t

macroVM_REGION_SUBMAP_SHORT_INFO_COUNT_64

#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 ((mach_msg_type_number_t)
	 (sizeof (vm_region_submap_short_info_data_64_t) / sizeof (natural_t)))

structmach_vm_read_entry

size 16, align 4
mach_vm_address_taddress
mach_vm_size_tsize

structvm_read_entry

size 16, align 4
vm_address_taddress
vm_size_tsize

macroVM_MAP_ENTRY_MAX

#define VM_MAP_ENTRY_MAX (256)

typedefmach_vm_read_entry_t

typedef struct mach_vm_read_entry mach_vm_read_entry_t[VM_MAP_ENTRY_MAX]

typedefvm_read_entry_t

typedef struct vm_read_entry vm_read_entry_t[VM_MAP_ENTRY_MAX]

macroVM_PAGE_INFO_MAX

#define VM_PAGE_INFO_MAX 

typedefvm_page_info_t

typedef int *vm_page_info_t

typedefvm_page_info_data_t

typedef int vm_page_info_data_t[VM_PAGE_INFO_MAX]

typedefvm_page_info_flavor_t

typedef int vm_page_info_flavor_t

macroVM_PAGE_INFO_BASIC

#define VM_PAGE_INFO_BASIC 1

structvm_page_info_basic

size 32, align 8
intdisposition
intref_count
vm_object_id_tobject_id
memory_object_offset_toffset
intdepth
int__padpad to 64-bit boundary

typedefvm_page_info_basic_t

typedef struct vm_page_info_basic *vm_page_info_basic_t

typedefvm_page_info_basic_data_t

typedef struct vm_page_info_basic vm_page_info_basic_data_t

macroVM_PAGE_INFO_BASIC_COUNT

#define VM_PAGE_INFO_BASIC_COUNT ((mach_msg_type_number_t)
	(sizeof(vm_page_info_basic_data_t)/sizeof(int)))