mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
Merge branch 'master' into dev
This commit is contained in:
commit
2fee6f98d7
6 changed files with 20 additions and 7 deletions
|
@ -58,7 +58,7 @@ static void mi_option_init(mi_option_desc_t* desc);
|
|||
long mi_option_get(mi_option_t option) {
|
||||
mi_assert(option >= 0 && option < _mi_option_last);
|
||||
mi_option_desc_t* desc = &options[option];
|
||||
if (desc->init == UNINIT) {
|
||||
if (mi_unlikely(desc->init == UNINIT)) {
|
||||
mi_option_init(desc);
|
||||
if (option != mi_option_verbose) {
|
||||
_mi_verbose_message("option '%s': %ld\n", desc->name, desc->value);
|
||||
|
@ -183,7 +183,8 @@ static void mi_option_init(mi_option_desc_t* desc) {
|
|||
#pragma warning(suppress:4996)
|
||||
char* s = getenv(buf);
|
||||
if (s == NULL) {
|
||||
for (size_t i = 0; i < strlen(buf); i++) {
|
||||
size_t buf_size = strlen(buf);
|
||||
for (size_t i = 0; i < buf_size; i++) {
|
||||
buf[i] = toupper(buf[i]);
|
||||
}
|
||||
#pragma warning(suppress:4996)
|
||||
|
@ -191,7 +192,8 @@ static void mi_option_init(mi_option_desc_t* desc) {
|
|||
}
|
||||
if (s != NULL) {
|
||||
mi_strlcpy(buf, s, sizeof(buf));
|
||||
for (size_t i = 0; i < strlen(buf); i++) {
|
||||
size_t buf_size = strlen(buf); // TODO: use strnlen?
|
||||
for (size_t i = 0; i < buf_size; i++) {
|
||||
buf[i] = toupper(buf[i]);
|
||||
}
|
||||
if (buf[0]==0 || strstr("1;TRUE;YES;ON", buf) != NULL) {
|
||||
|
|
2
src/os.c
2
src/os.c
|
@ -209,7 +209,7 @@ static void* mi_win_virtual_alloc(void* addr, size_t size, size_t try_alignment,
|
|||
void* p = NULL;
|
||||
if (use_large_os_page(size, try_alignment)) {
|
||||
if (large_page_try_ok > 0) {
|
||||
// if a large page page allocation fails, it seems the calls to VirtualAlloc get very expensive.
|
||||
// if a large page allocation fails, it seems the calls to VirtualAlloc get very expensive.
|
||||
// therefore, once a large page allocation failed, we don't try again for `large_page_try_ok` times.
|
||||
large_page_try_ok--;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue