From fa5dc176213b557bcd0bc0b2c7bd953b576547f1 Mon Sep 17 00:00:00 2001 From: daan Date: Tue, 23 Jul 2019 15:09:54 -0700 Subject: [PATCH] fix merge conflicts --- src/options.c | 20 ++------------------ src/os.c | 5 ----- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/options.c b/src/options.c index 349599ad..56fb4851 100644 --- a/src/options.c +++ b/src/options.c @@ -37,7 +37,6 @@ typedef struct mi_option_desc_s { const char* name; // option name without `mimalloc_` prefix } mi_option_desc_t; -<<<<<<< HEAD static mi_option_desc_t options[_mi_option_last] = { // stable options @@ -45,16 +44,6 @@ static mi_option_desc_t options[_mi_option_last] = { MI_DEBUG, UNINIT, "show_errors" }, { 0, UNINIT, "verbose" }, -======= -static mi_option_desc_t options[_mi_option_last] = { - { 0, UNINIT, "page_reset" }, - { 0, UNINIT, "cache_reset" }, - { 0, UNINIT, "pool_commit" }, - { 0, UNINIT, "eager_commit" }, // secure and large pages must have eager commit - { 0, UNINIT, "large_os_pages" }, // use large OS pages - { 0, UNINIT, "reset_decommits" }, - { 0, UNINIT, "reset_discards" }, ->>>>>>> add comment about large pages #if MI_SECURE { MI_SECURE, INITIALIZED, "secure" }, // in a secure build the environment setting is ignored #else @@ -215,16 +204,11 @@ static const char* mi_getenv(const char* name) { #pragma warning(suppress:4996) const char* s = getenv(name); if (s == NULL) { -<<<<<<< HEAD - char buf[64+1]; - mi_strlcpy(buf,name,64); - for (size_t i = 0; i < strlen(buf); i++) { - buf[i] = toupper(name[i]); -======= + char buf[64]; + mi_strlcpy(buf,name,sizeof(buf)); size_t buf_size = strlen(buf); for (size_t i = 0; i < buf_size; i++) { buf[i] = toupper(buf[i]); ->>>>>>> Avoid using strlen function in loop } #pragma warning(suppress:4996) s = getenv(buf); diff --git a/src/os.c b/src/os.c index f6358912..56abd55d 100644 --- a/src/os.c +++ b/src/os.c @@ -202,14 +202,9 @@ static void* mi_win_virtual_alloc(void* addr, size_t size, size_t try_alignment, static volatile uintptr_t large_page_try_ok = 0; void* p = NULL; if (use_large_os_page(size, try_alignment)) { -<<<<<<< HEAD - if (large_page_try_ok > 0) { - // if a large page allocation fails, it seems the calls to VirtualAlloc get very expensive. -======= uintptr_t try_ok = mi_atomic_read(&large_page_try_ok); if (try_ok > 0) { // if a large page page allocation fails, it seems the calls to VirtualAlloc get very expensive. ->>>>>>> use atomic ops to guard large page tries on windows // therefore, once a large page allocation failed, we don't try again for `large_page_try_ok` times. mi_atomic_compare_exchange(&large_page_try_ok, try_ok - 1, try_ok); }