GrapheneOS/hardened_malloc ? reverse-engineered prompt
Reverse engineered prompt
Build me a security focused memory allocator in C that can replace the usual malloc on Linux, and also work with Android. It should be designed to make heap corruption harder, with strong checks around freed memory, guard regions, randomization, and support for quarantining suspicious allocations. I want it to work as a normal shared library for Linux, with a simple preload option so I can test existing apps without rebuilding them, and it should also fit into Android style builds.
Please include a clear README, a build that works with the provided Makefile setup, basic config options, and a small test suite I can run with make test. If there are any platform specific requirements or current docs I should check online, look them up and follow the latest guidance. Keep it focused on safety, compatibility, and decent performance for real apps, not just micro benchmarks.
Are you gonna build this?
make sure you review the code using coderabbit