Infrastructure and build updates
- Update build configuration and flags - Add missing header files and dependencies - Update TLS list implementation with proper scoping - Fix various compilation warnings and issues - Update debug ring and tiny allocation infrastructure - Update benchmark results documentation Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
#include <stdatomic.h>
|
||||
#include <stdint.h>
|
||||
#include <pthread.h>
|
||||
#include "tiny_nextptr.h"
|
||||
|
||||
// Forward declarations
|
||||
typedef struct TinySlab TinySlab;
|
||||
@ -24,13 +25,7 @@ static inline void bg_spill_push_one(int class_idx, void* p) {
|
||||
uintptr_t old_head;
|
||||
do {
|
||||
old_head = atomic_load_explicit(&g_bg_spill_head[class_idx], memory_order_acquire);
|
||||
// Phase 7: header-aware next placement (C0-C6: base+1, C7: base)
|
||||
#if HAKMEM_TINY_HEADER_CLASSIDX
|
||||
const size_t next_off = (class_idx == 7) ? 0 : 1;
|
||||
#else
|
||||
const size_t next_off = 0;
|
||||
#endif
|
||||
*(void**)((uint8_t*)p + next_off) = (void*)old_head;
|
||||
tiny_next_store(p, class_idx, (void*)old_head);
|
||||
} while (!atomic_compare_exchange_weak_explicit(&g_bg_spill_head[class_idx], &old_head,
|
||||
(uintptr_t)p,
|
||||
memory_order_release, memory_order_relaxed));
|
||||
@ -42,13 +37,7 @@ static inline void bg_spill_push_chain(int class_idx, void* head, void* tail, in
|
||||
uintptr_t old_head;
|
||||
do {
|
||||
old_head = atomic_load_explicit(&g_bg_spill_head[class_idx], memory_order_acquire);
|
||||
// Phase 7: header-aware next placement for tail link
|
||||
#if HAKMEM_TINY_HEADER_CLASSIDX
|
||||
const size_t next_off = (class_idx == 7) ? 0 : 1;
|
||||
#else
|
||||
const size_t next_off = 0;
|
||||
#endif
|
||||
*(void**)((uint8_t*)tail + next_off) = (void*)old_head;
|
||||
tiny_next_store(tail, class_idx, (void*)old_head);
|
||||
} while (!atomic_compare_exchange_weak_explicit(&g_bg_spill_head[class_idx], &old_head,
|
||||
(uintptr_t)head,
|
||||
memory_order_release, memory_order_relaxed));
|
||||
|
||||
Reference in New Issue
Block a user