mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 11:58:41 +03:00
use pragma warning only on msvc (issue #291)
This commit is contained in:
parent
d73d6beb71
commit
032eb2a75a
3 changed files with 15 additions and 8 deletions
5
src/os.c
5
src/os.c
|
@ -22,6 +22,10 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
|
||||
#include <string.h> // strerror
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4996) // strerror
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <Windows.h>
|
||||
|
@ -233,7 +237,6 @@ static bool mi_os_mem_free(void* addr, size_t size, bool was_committed, mi_stats
|
|||
if (was_committed) _mi_stat_decrease(&stats->committed, size);
|
||||
_mi_stat_decrease(&stats->reserved, size);
|
||||
if (err) {
|
||||
#pragma warning(suppress:4996)
|
||||
_mi_warning_message("munmap failed: %s, addr 0x%8li, size %lu\n", strerror(errno), (size_t)addr, size);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue