add preload check to options initialization
This commit is contained in:
parent
a407f35c64
commit
36d168a2d9
@ -367,6 +367,10 @@ static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
||||
}
|
||||
#endif
|
||||
static void mi_option_init(mi_option_desc_t* desc) {
|
||||
#ifndef _WIN32
|
||||
// cannot call getenv() when still initializing the C runtime.
|
||||
if (_mi_preloading()) return;
|
||||
#endif
|
||||
// Read option value from the environment
|
||||
char buf[64+1];
|
||||
mi_strlcpy(buf, "mimalloc_", sizeof(buf));
|
||||
|
Loading…
Reference in New Issue
Block a user