- Add a redirected malloc referred to [1].
It is a temporary scheme to make memory management functions work.
[2] is a recent report published by mimalloc, in which leading memory
allocators were evaluated.
- Add an optional argument REDIRECTED to add_libc_unittest.
Unit tests do not depend on libllvmlibc.a static library which
links libllvmlibc_redirectors.so shared library. [3]
[1] https://reviews.llvm.org/D69020
[2] https://www.microsoft.com/en-us/research/uploads/prod/2019/06/mimalloc-tr-v1.pdf
[3] https://github.com/llvm/llvm-project/blob/main/libc/docs/redirectors_schematic.svg
Also tried here:
But malloc unit test failed for passing -nostdlib below to linker.
Would it work fine after the TODO(libc/cmake/modules/LLVMLibCLibraryRules.cmake, line: 133) fixed?