mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 06:59:32 +03:00
add preload check to options initialization
This commit is contained in:
parent
a407f35c64
commit
36d168a2d9
1 changed files with 13 additions and 9 deletions
|
@ -367,6 +367,10 @@ static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
static void mi_option_init(mi_option_desc_t* desc) {
|
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
|
// Read option value from the environment
|
||||||
char buf[64+1];
|
char buf[64+1];
|
||||||
mi_strlcpy(buf, "mimalloc_", sizeof(buf));
|
mi_strlcpy(buf, "mimalloc_", sizeof(buf));
|
||||||
|
|
Loading…
Add table
Reference in a new issue