I am involved in both macOS and Linux.
Linux automatically erases every freed memory in order to prevent leakage of information left in freed memory, and also to prevent attacks that seek or rely on information left in freed memory (e.g. uninitialized variable attacks, use-after-free attacks, reuse attacks, stack content exposures, and heap content exposures) (https://www.kernel.org/doc/html/v4.18/security/self-protection.html). I like this feature of Linux, and I am wondering if macOS has this feature as well.
Does macOS automatically erase every freed memory?
(Assuming #1 is positive) Since which version of MacOSX, OSX or macOS, has it been equipped with this feature of automatic erasure of freed memory?
When you answer, try to point out an official Apple document (either at developer.apple.com or support.apple.com but NOT forum.apple.com) that supports your answer.
By the way, Linux Kernel Self-Protection includes "memory poisoning", which does more than "memory erasure". "Memory Poisoning" fills the freed memory with a special signature in order to identify bad or corrupted memory data and warn the system when this bad data is eventually read (https://patents.google.com/patent/US20140006879A1/en).