Oh I was reading: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/vm/vm.html
the section with "Allocating Memory In the Kernel Itself". But it is probably old news.
Looks like I can call OSMalloc, with our own-allocator with quantum set over kalloc_kernmap_size. I will try that first.
While I have your attention (do I though?) - it would be nice if we could use xnu's kalloc.zones, but we struggled with it for quite a long time. The issue was always that the machine would simply panic, if it ran out of a zone. (say, zone.64)
Surely there is a way to be told/warned/event that a zone is getting full, or under pressure? Would really like to avoid panic, even if it means stalling an allocation long enough for it to reap. We never found a memory-pressure system we were allowed to call, (or it was calling us After it spun looking for memory and calling panic).
Topic:
App & System Services
SubTopic:
Core OS
Tags: