[libc-commits] [PATCH] D95504: [libc] Add redirected malloc using system-libc.

Cheng Wang via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jan 26 21:16:53 PST 2021


cheng.w created this revision.
cheng.w added a reviewer: sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added a project: libc-project.
cheng.w requested review of this revision.

1. 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.

2. 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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95504

Files:
  libc/cmake/modules/LLVMLibCTestRules.cmake
  libc/config/linux/aarch64/entrypoints.txt
  libc/config/linux/api.td
  libc/config/linux/x86_64/entrypoints.txt
  libc/lib/CMakeLists.txt
  libc/spec/stdc.td
  libc/src/stdlib/CMakeLists.txt
  libc/src/stdlib/malloc.cpp
  libc/src/stdlib/malloc.h
  libc/src/stdlib/malloc_redirector.cpp
  libc/test/src/stdlib/CMakeLists.txt
  libc/test/src/stdlib/malloc_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95504.319462.patch
Type: text/x-patch
Size: 7856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210127/31741bc9/attachment.bin>


More information about the libc-commits mailing list