mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 15:09:31 +03:00
merge in dev branch
This commit is contained in:
commit
cec3c4f9ff
3 changed files with 3 additions and 5 deletions
|
@ -52,8 +52,7 @@ terms of the MIT license. A copy of the license can be found in the file
|
||||||
MI_INTERPOSE_MI(realloc),
|
MI_INTERPOSE_MI(realloc),
|
||||||
MI_INTERPOSE_MI(free),
|
MI_INTERPOSE_MI(free),
|
||||||
MI_INTERPOSE_MI(strdup),
|
MI_INTERPOSE_MI(strdup),
|
||||||
MI_INTERPOSE_MI(strndup),
|
MI_INTERPOSE_MI(strndup)
|
||||||
MI_INTERPOSE_MI(realpath)
|
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
// On all other systems forward to our API
|
// On all other systems forward to our API
|
||||||
|
@ -63,7 +62,6 @@ terms of the MIT license. A copy of the license can be found in the file
|
||||||
void free(void* p) mi_attr_noexcept MI_FORWARD0(mi_free, p);
|
void free(void* p) mi_attr_noexcept MI_FORWARD0(mi_free, p);
|
||||||
char* strdup(const char* s) MI_FORWARD1(mi_strdup, s);
|
char* strdup(const char* s) MI_FORWARD1(mi_strdup, s);
|
||||||
char* strndup(const char* s, size_t n) MI_FORWARD2(mi_strndup, s, n);
|
char* strndup(const char* s, size_t n) MI_FORWARD2(mi_strndup, s, n);
|
||||||
char* realpath(const char* fname, char* resolved_name) MI_FORWARD2(mi_realpath, fname, resolved_name);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__MACH__)
|
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__MACH__)
|
||||||
|
|
1
src/os.c
1
src/os.c
|
@ -415,6 +415,7 @@ bool _mi_os_decommit(void* addr, size_t size, mi_stats_t* stats) {
|
||||||
return mi_os_commitx(addr, size, false, stats);
|
return mi_os_commitx(addr, size, false, stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------
|
/* -----------------------------------------------------------
|
||||||
OS allocation using mmap/munmap
|
OS allocation using mmap/munmap
|
||||||
----------------------------------------------------------- */
|
----------------------------------------------------------- */
|
||||||
|
|
|
@ -201,7 +201,6 @@ static void mi_segment_os_free(mi_segment_t* segment, size_t segment_size, mi_se
|
||||||
#define MI_SEGMENT_CACHE_MAX (4)
|
#define MI_SEGMENT_CACHE_MAX (4)
|
||||||
#define MI_SEGMENT_CACHE_FRACTION (8)
|
#define MI_SEGMENT_CACHE_FRACTION (8)
|
||||||
|
|
||||||
|
|
||||||
static mi_segment_t* mi_segment_cache_pop(size_t segment_size, mi_segments_tld_t* tld) {
|
static mi_segment_t* mi_segment_cache_pop(size_t segment_size, mi_segments_tld_t* tld) {
|
||||||
if (segment_size != 0 && segment_size != MI_SEGMENT_SIZE) return NULL;
|
if (segment_size != 0 && segment_size != MI_SEGMENT_SIZE) return NULL;
|
||||||
mi_segment_t* segment = tld->cache;
|
mi_segment_t* segment = tld->cache;
|
||||||
|
|
Loading…
Add table
Reference in a new issue