#include <mach_debug/zone_info.h>
mach_debug/zone_info.h
macroZONE_NAME_MAX_LEN
#define ZONE_NAME_MAX_LEN 80
structzone_name
| 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
| integer_t | zi_count | Number of elements used now |
| vm_size_t | zi_cur_size | current memory utilization |
| vm_size_t | zi_max_size | how large can this zone grow |
| vm_size_t | zi_elem_size | size of an element |
| vm_size_t | zi_alloc_size | size used for more memory |
| integer_t | zi_pageable | zone pageable? |
| integer_t | zi_sleepable | sleep if empty? |
| integer_t | zi_exhaustible | merely return if empty? |
| integer_t | zi_collectable | garbage 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
| 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
| uint64_t | mzi_count | count of elements in use |
| uint64_t | mzi_cur_size | current memory utilization |
| uint64_t | mzi_max_size | how large can this zone grow |
| uint64_t | mzi_elem_size | size of an element |
| uint64_t | mzi_alloc_size | size used for more memory |
| uint64_t | mzi_sum_size | sum of all allocs (life of zone) |
| uint64_t | mzi_exhaustible | merely return if empty? |
| uint64_t | mzi_collectable | garbage 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
| uint64_t | tzi_count | count of elements in use |
| uint64_t | tzi_cur_size | current memory utilization |
| uint64_t | tzi_max_size | how large can this zone grow |
| uint64_t | tzi_elem_size | size of an element |
| uint64_t | tzi_alloc_size | size used for more memory |
| uint64_t | tzi_sum_size | sum of all allocs (life of zone) |
| uint64_t | tzi_exhaustible | merely return if empty? |
| uint64_t | tzi_collectable | garbage collect elements? |
| uint64_t | tzi_caller_acct | charged to caller (or kernel) |
| uint64_t | tzi_task_alloc | sum of all allocs by this task |
| uint64_t | tzi_task_free | sum 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
| uint64_t | flags | |
| uint64_t | site | |
| uint64_t | size | |
| uint64_t | free | |
| uint64_t | largest | |
| uint64_t | collectable_bytes | |
| uint64_t | mapped | |
| uint64_t | peak | |
| uint16_t | tag | |
| uint16_t | zone | |
| 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().
| uint32_t | ref_count | no. of active references on the record |
| uint32_t | operation_type | operation type (alloc/free) |
| uint64_t[15] | bt | backtrace |
typedefzone_btrecord_t
typedef struct zone_btrecord zone_btrecord_t;
typedefzone_btrecord_array_t
typedef zone_btrecord_t *zone_btrecord_array_t