[PATCH] D71786: RFC: [Support] On Windows, add optional support for rpmalloc

Rich Felker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 11:30:32 PDT 2020


dalias added a comment.

Coming from the unixy side (musl), there is no reasonable way short of self-exec with `LD_PRELOAD` (which has reasonableness problems itself since it'd be inherited by child processes) to make a `-fintegrated-crt-alloc` where replacement of malloc is runtime-conditional. And the only way to (non-statically) initialize a replacement is init-on-first-use (`call_once` style; this can be done without barriers if needed using a not-widely-known algorithm you can dig up). The better way is just making the statically initialized state a valid initial state.

The right way to do this is just to link the replacement into the binaries `clang`, `lld`, etc. - **NOT** the LLVM shared libraries - if the user selects a malloc replacement at build time, and optionally default to doing so if that's what you decide is the right default.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71786/new/

https://reviews.llvm.org/D71786





More information about the llvm-commits mailing list