[PATCH] D71786: RFC: [Support] On Windows, add optional support for {rpmalloc|snmalloc|mimalloc}

Mattias Jansson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 00:29:40 PDT 2020


maniccoder added a comment.

In D71786#2127154 <https://reviews.llvm.org/D71786#2127154>, @aganea wrote:

> Replacing the allocator dynamically at startup could be possible, but that's a lot of trouble. If that's we want, I could check if we can load a DLL from a TLS callback <https://stackoverflow.com/a/36891752>, because we need the allocator very early, before the CRT entry point is called.


I think a TLS would fall in the "unspecified order" category of global constructors and that you on Windows need to use the CRT data segments ".CRT$XIx" to ensure it is called before anything might be allocating memory as I wrote about earlier: https://gist.github.com/mjansson/8a573974473e1d69a2299444cd41bea9

Anyway, not sure you can load a DLL without it calling in to the allocator though :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71786





More information about the llvm-commits mailing list