mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 23:19:31 +03:00
remove unused fields from OS thread local data
This commit is contained in:
parent
ed785253bf
commit
737b05cc25
3 changed files with 5 additions and 9 deletions
|
@ -380,12 +380,8 @@ typedef struct mi_segments_tld_s {
|
||||||
} mi_segments_tld_t;
|
} mi_segments_tld_t;
|
||||||
|
|
||||||
// OS thread local data
|
// OS thread local data
|
||||||
typedef struct mi_os_tld_s {
|
typedef struct mi_os_tld_s {
|
||||||
uintptr_t mmap_next_probable; // probable next address start allocated by mmap (to guess which path to take on alignment)
|
mi_stats_t* stats; // points to tld stats
|
||||||
void* mmap_previous; // previous address returned by mmap
|
|
||||||
uint8_t* pool; // pool of segments to reduce mmap calls on some platforms
|
|
||||||
size_t pool_available; // bytes available in the pool
|
|
||||||
mi_stats_t* stats; // points to tld stats
|
|
||||||
} mi_os_tld_t;
|
} mi_os_tld_t;
|
||||||
|
|
||||||
// Thread local data
|
// Thread local data
|
||||||
|
|
|
@ -237,7 +237,7 @@ void mi_free(void* p) mi_attr_noexcept
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uintptr_t tid = _mi_thread_id();
|
uintptr_t tid = _mi_thread_id();
|
||||||
if (mi_likely(tid == page->flags)) {
|
if (mi_likely(tid == page->flags)) { // if equal, the thread id matches and it is not a full page, nor has aligned blocks
|
||||||
// local, and not full or aligned
|
// local, and not full or aligned
|
||||||
mi_block_t* block = (mi_block_t*)p;
|
mi_block_t* block = (mi_block_t*)p;
|
||||||
mi_block_set_next(page, block, page->local_free);
|
mi_block_set_next(page, block, page->local_free);
|
||||||
|
|
|
@ -98,8 +98,8 @@ static mi_tld_t tld_main = {
|
||||||
0,
|
0,
|
||||||
&_mi_heap_main,
|
&_mi_heap_main,
|
||||||
{ { NULL, NULL }, {NULL ,NULL}, 0, 0, 0, 0, 0, 0, NULL, tld_main_stats }, // segments
|
{ { NULL, NULL }, {NULL ,NULL}, 0, 0, 0, 0, 0, 0, NULL, tld_main_stats }, // segments
|
||||||
{ 0, NULL, NULL, 0, tld_main_stats }, // os
|
{ tld_main_stats }, // os
|
||||||
{ MI_STATS_NULL } // stats
|
{ MI_STATS_NULL } // stats
|
||||||
};
|
};
|
||||||
|
|
||||||
mi_heap_t _mi_heap_main = {
|
mi_heap_t _mi_heap_main = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue