🍎 purgeable 状态系
purge_set_0->1 易失化:占住→让内核可偷(旧态->想要的新态;0=非易失 1=易失 2=清空)
purge_set_1->0 非易失化:重新占住(回前台/要写内容)
purge_set_2->0 被偷后重占:内容已丢,需重绘(内存压力实锤)
purge_set_0->2 主动清空丢弃
…_kr2 内核拒绝:映射只读(vm_map.c L18587)· _kr4 对象非purgeable(L18596)
purge_get_2 查询发现内容已被偷(其他态=金色查询)
ca_volatile_1/0 CA 策略层标记(异步,与 SET 中位差约22ms)
vm_allocate_purg / vm_map_purg:VM_FLAGS_PURGABLE 新建(便捷入口 / mach_vm_map 全功能入口)
📱 IOSurface / CoreVideo 系
iosurface_create_purg:purgeable(创建字典含 purgeable/volatile 相关键=TRUE——按 dump 出的真实键名判定,不猜符号)
iosurface_create_np:非 purgeable(字典无相关键=创建期默认非;或相关键=false。悬停「按接口」表对应行可看完整创建字典样本)
iosurface_create_unk:无法判定(字典读不出/超24条/值类型不识——≠"非purgeable";批量出现=dump 探针失效,报告我)
iosurface_lookup:跨进程接收 surface(camera/VideoToolbox/WebKit → 本进程)
iosurface_purg_{n}:IOSurfaceSetPurgeable——n=低字节状态(0非易失/1易失/2清空/3保持),高位私有标志入 extra.raw(如 257=0x101→易失|0x100),失败带 _e{IOReturn}
cvpixelbuf_create[_purg/_np/_unk] / cvpixelbuf_pool:CoreVideo 像素缓冲(池),三态同 IOSurface
🧱 基础分配系
malloc / calloc / realloc / valloc / posix_memalign / malloc_zone_*:堆分配
mmap / vm_allocate:VM 匿名映射(非 purgeable)
<free>munmap / <free>vm_deallocate:释放计数(仅📊存量模式)