mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
use standard compliant compilation of the thread_free atomic field
This commit is contained in:
parent
2cf419c9bc
commit
5ad2effb39
5 changed files with 73 additions and 57 deletions
|
@ -134,20 +134,9 @@ typedef union mi_page_flags_u {
|
|||
} mi_page_flags_t;
|
||||
|
||||
// Thread free list.
|
||||
// We use 2 bits of the pointer for the `use_delayed_free` and `delayed_freeing` flags.
|
||||
typedef union mi_thread_free_u {
|
||||
volatile uintptr_t value;
|
||||
struct {
|
||||
uintptr_t delayed:2;
|
||||
#if MI_INTPTR_SIZE==8
|
||||
uintptr_t head:62; // head free block in the list (right-shifted by 2)
|
||||
#elif MI_INTPTR_SIZE==4
|
||||
uintptr_t head:30;
|
||||
#endif
|
||||
};
|
||||
} mi_thread_free_t;
|
||||
// We use bottom 2 bits of the pointer for mi_delayed_t flags
|
||||
typedef uintptr_t mi_thread_free_t;
|
||||
|
||||
#define MI_TF_PTR_SHIFT (2)
|
||||
|
||||
// A page contains blocks of one specific size (`block_size`).
|
||||
// Each page has three list of free blocks:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue