There are probably other ways to preload a shared library but this is a typical way for a regular user to do it.
We can check (in LUE's main __init__.py) whether LD_PRELOAD contains the name of the allocator used to build LUE (tcmalloc in this case), and if not we can warn the user that the process may crash because of this.
Options:
Warn the user and continue. Maybe it should be possible for the user to make the warning go away in case the shared library is loaded by some other means.
Warn the user and stop. Maybe it should be possible for the user to force the process to continue in case the shared library is loaded by some other means.
Iff LUE is built with a custom allocator (it should), this allocator must be loaded before Python start executing. Example:
There are probably other ways to preload a shared library but this is a typical way for a regular user to do it.
We can check (in LUE's main
__init__.py
) whetherLD_PRELOAD
contains the name of the allocator used to build LUE (tcmalloc
in this case), and if not we can warn the user that the process may crash because of this.Options: