mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
Merge branch 'dev3' into dev3-bin
This commit is contained in:
commit
35e81c1a3d
5 changed files with 54 additions and 30 deletions
|
@ -18,11 +18,7 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
#include "track.h"
|
||||
#include "bits.h"
|
||||
|
||||
#if (MI_DEBUG>0)
|
||||
#define mi_trace_message(...) _mi_trace_message(__VA_ARGS__)
|
||||
#else
|
||||
#define mi_trace_message(...)
|
||||
#endif
|
||||
#define mi_decl_cache_align mi_decl_align(64)
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(disable:4127) // suppress constant conditional warning (due to MI_SECURE paths)
|
||||
|
@ -52,19 +48,32 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
#define mi_decl_hidden
|
||||
#endif
|
||||
|
||||
#define mi_decl_cache_align mi_decl_align(64)
|
||||
#if (defined(__GNUC__) && (__GNUC__ >= 7)) || defined(__clang__) // includes clang and icc
|
||||
#define mi_decl_maybe_unused __attribute__((unused))
|
||||
#elif __cplusplus >= 201703L // c++17
|
||||
#define mi_decl_maybe_unused [[maybe_unused]]
|
||||
#else
|
||||
#define mi_decl_maybe_unused
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define mi_decl_externc extern "C"
|
||||
#else
|
||||
#define mi_decl_externc
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__EMSCRIPTEN__) && !defined(__wasi__)
|
||||
#define __wasi__
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define mi_decl_externc extern "C"
|
||||
#if (MI_DEBUG>0)
|
||||
#define mi_trace_message(...) _mi_trace_message(__VA_ARGS__)
|
||||
#else
|
||||
#define mi_decl_externc
|
||||
#define mi_trace_message(...)
|
||||
#endif
|
||||
|
||||
|
||||
// "libc.c"
|
||||
#include <stdarg.h>
|
||||
int _mi_vsnprintf(char* buf, size_t bufsize, const char* fmt, va_list args);
|
||||
|
@ -644,8 +653,9 @@ static inline bool mi_page_is_used_at_frac(const mi_page_t* page, uint16_t n) {
|
|||
|
||||
|
||||
static inline bool mi_page_is_huge(const mi_page_t* page) {
|
||||
return (page->block_size > MI_LARGE_MAX_OBJ_SIZE ||
|
||||
(mi_memkind_is_os(page->memid.memkind) && page->memid.mem.os.base < (void*)page));
|
||||
return (mi_page_is_singleton(page) &&
|
||||
(page->block_size > MI_LARGE_MAX_OBJ_SIZE ||
|
||||
(mi_memkind_is_os(page->memid.memkind) && page->memid.mem.os.base < (void*)page)));
|
||||
}
|
||||
|
||||
static inline mi_page_queue_t* mi_page_queue(const mi_heap_t* heap, size_t size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue