mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 06:59:32 +03:00
add preload check in option initialization (issues #179)
This commit is contained in:
parent
acb03c5497
commit
e31e609414
1 changed files with 10 additions and 6 deletions
|
@ -366,6 +366,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…
Add table
Reference in a new issue