fix merge conflicts

This commit is contained in:
daan 2019-07-23 15:09:54 -07:00
parent ab022e4271
commit fa5dc17621
2 changed files with 2 additions and 23 deletions

View file

@ -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);

View file

@ -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);
}