#include <mach_debug/zone_info.h>

mach_debug/zone_info.h

14 typedefs · 10 macros · 7 structs

macroZONE_NAME_MAX_LEN

#define ZONE_NAME_MAX_LEN 80

structzone_name

size 80, align 1
char[80]zn_name

typedefzone_name_t

typedef struct zone_name zone_name_t;

typedefzone_name_array_t

typedef zone_name_t *zone_name_array_t

structzone_info

size 56, align 8
integer_tzi_countNumber of elements used now
vm_size_tzi_cur_sizecurrent memory utilization
vm_size_tzi_max_sizehow large can this zone grow
vm_size_tzi_elem_sizesize of an element
vm_size_tzi_alloc_sizesize used for more memory
integer_tzi_pageablezone pageable?
integer_tzi_sleepablesleep if empty?
integer_tzi_exhaustiblemerely return if empty?
integer_tzi_collectablegarbage collect elements?

typedefzone_info_t

typedef struct zone_info zone_info_t;

typedefzone_info_array_t

typedef zone_info_t *zone_info_array_t

macroMACH_ZONE_NAME_MAX_LEN

#define MACH_ZONE_NAME_MAX_LEN 80

structmach_zone_name

size 80, align 1
char[80]mzn_name

typedefmach_zone_name_t

typedef struct mach_zone_name mach_zone_name_t;

typedefmach_zone_name_array_t

typedef mach_zone_name_t *mach_zone_name_array_t

structmach_zone_info_data

size 64, align 8
uint64_tmzi_countcount of elements in use
uint64_tmzi_cur_sizecurrent memory utilization
uint64_tmzi_max_sizehow large can this zone grow
uint64_tmzi_elem_sizesize of an element
uint64_tmzi_alloc_sizesize used for more memory
uint64_tmzi_sum_sizesum of all allocs (life of zone)
uint64_tmzi_exhaustiblemerely return if empty?
uint64_tmzi_collectablegarbage collect elements? and how much?

typedefmach_zone_info_t

typedef struct mach_zone_info_data mach_zone_info_t;

typedefmach_zone_info_array_t

typedef mach_zone_info_t *mach_zone_info_array_t

macroGET_MZI_COLLECTABLE_BYTES

The lowest bit of mzi_collectable indicates whether or not the zone is collectable by zone_gc(). The higher bits contain the size in bytes that can be collected.
#define GET_MZI_COLLECTABLE_BYTES(val) ((val) >> 1)

macroGET_MZI_COLLECTABLE_FLAG

#define GET_MZI_COLLECTABLE_FLAG(val) ((val) & 1)

macroSET_MZI_COLLECTABLE_BYTES

#define SET_MZI_COLLECTABLE_BYTES(val, size) (val) = ((val) & 1) | ((size) << 1)

macroSET_MZI_COLLECTABLE_FLAG

#define SET_MZI_COLLECTABLE_FLAG(val, flag) (val) = (flag) ? ((val) | 1) : (val)

structtask_zone_info_data

size 88, align 8
uint64_ttzi_countcount of elements in use
uint64_ttzi_cur_sizecurrent memory utilization
uint64_ttzi_max_sizehow large can this zone grow
uint64_ttzi_elem_sizesize of an element
uint64_ttzi_alloc_sizesize used for more memory
uint64_ttzi_sum_sizesum of all allocs (life of zone)
uint64_ttzi_exhaustiblemerely return if empty?
uint64_ttzi_collectablegarbage collect elements?
uint64_ttzi_caller_acctcharged to caller (or kernel)
uint64_ttzi_task_allocsum of all allocs by this task
uint64_ttzi_task_freesum of all frees by this task

typedeftask_zone_info_t

typedef struct task_zone_info_data task_zone_info_t;

typedeftask_zone_info_array_t

typedef task_zone_info_t *task_zone_info_array_t

macroMACH_MEMORY_INFO_NAME_MAX_LEN

#define MACH_MEMORY_INFO_NAME_MAX_LEN 80

structmach_memory_info

size 176, align 8
uint64_tflags
uint64_tsite
uint64_tsize
uint64_tfree
uint64_tlargest
uint64_tcollectable_bytes
uint64_tmapped
uint64_tpeak
uint16_ttag
uint16_tzone
uint16_t[2]_resvA
uint64_t[3]_resv
char[80]name

typedefmach_memory_info_t

typedef struct mach_memory_info mach_memory_info_t;

typedefmach_memory_info_array_t

typedef mach_memory_info_t *mach_memory_info_array_t

macroMAX_ZTRACE_DEPTH

#define MAX_ZTRACE_DEPTH 15

macroZOP_ALLOC

#define ZOP_ALLOC 1

macroZOP_FREE

#define ZOP_FREE 0

structzone_btrecord

Structure used to copy out btlog records to userspace, via the MIG call mach_zone_get_btlog_records().
size 128, align 8
uint32_tref_countno. of active references on the record
uint32_toperation_typeoperation type (alloc/free)
uint64_t[15]btbacktrace

typedefzone_btrecord_t

typedef struct zone_btrecord zone_btrecord_t;

typedefzone_btrecord_array_t

typedef zone_btrecord_t *zone_btrecord_array_t