mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 07:29:30 +03:00
fix merge conflicts
This commit is contained in:
parent
ab022e4271
commit
fa5dc17621
2 changed files with 2 additions and 23 deletions
|
@ -37,7 +37,6 @@ typedef struct mi_option_desc_s {
|
||||||
const char* name; // option name without `mimalloc_` prefix
|
const char* name; // option name without `mimalloc_` prefix
|
||||||
} mi_option_desc_t;
|
} mi_option_desc_t;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
static mi_option_desc_t options[_mi_option_last] =
|
static mi_option_desc_t options[_mi_option_last] =
|
||||||
{
|
{
|
||||||
// stable options
|
// stable options
|
||||||
|
@ -45,16 +44,6 @@ static mi_option_desc_t options[_mi_option_last] =
|
||||||
{ MI_DEBUG, UNINIT, "show_errors" },
|
{ MI_DEBUG, UNINIT, "show_errors" },
|
||||||
{ 0, UNINIT, "verbose" },
|
{ 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
|
#if MI_SECURE
|
||||||
{ MI_SECURE, INITIALIZED, "secure" }, // in a secure build the environment setting is ignored
|
{ MI_SECURE, INITIALIZED, "secure" }, // in a secure build the environment setting is ignored
|
||||||
#else
|
#else
|
||||||
|
@ -215,16 +204,11 @@ static const char* mi_getenv(const char* name) {
|
||||||
#pragma warning(suppress:4996)
|
#pragma warning(suppress:4996)
|
||||||
const char* s = getenv(name);
|
const char* s = getenv(name);
|
||||||
if (s == NULL) {
|
if (s == NULL) {
|
||||||
<<<<<<< HEAD
|
char buf[64];
|
||||||
char buf[64+1];
|
mi_strlcpy(buf,name,sizeof(buf));
|
||||||
mi_strlcpy(buf,name,64);
|
|
||||||
for (size_t i = 0; i < strlen(buf); i++) {
|
|
||||||
buf[i] = toupper(name[i]);
|
|
||||||
=======
|
|
||||||
size_t buf_size = strlen(buf);
|
size_t buf_size = strlen(buf);
|
||||||
for (size_t i = 0; i < buf_size; i++) {
|
for (size_t i = 0; i < buf_size; i++) {
|
||||||
buf[i] = toupper(buf[i]);
|
buf[i] = toupper(buf[i]);
|
||||||
>>>>>>> Avoid using strlen function in loop
|
|
||||||
}
|
}
|
||||||
#pragma warning(suppress:4996)
|
#pragma warning(suppress:4996)
|
||||||
s = getenv(buf);
|
s = getenv(buf);
|
||||||
|
|
5
src/os.c
5
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;
|
static volatile uintptr_t large_page_try_ok = 0;
|
||||||
void* p = NULL;
|
void* p = NULL;
|
||||||
if (use_large_os_page(size, try_alignment)) {
|
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);
|
uintptr_t try_ok = mi_atomic_read(&large_page_try_ok);
|
||||||
if (try_ok > 0) {
|
if (try_ok > 0) {
|
||||||
// if a large page page allocation fails, it seems the calls to VirtualAlloc get very expensive.
|
// 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.
|
// 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);
|
mi_atomic_compare_exchange(&large_page_try_ok, try_ok - 1, try_ok);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue