Legacy cleanup: Remove obsolete test files and #if 0 blocks (-1,750 LOC)
(cherry-picked from cc0104c4e)
This commit is contained in:
@ -101,53 +101,7 @@ static inline __attribute__((always_inline)) void tiny_next_store(void* base, in
|
|||||||
// causing all blocks in a slab to appear "misaligned"
|
// causing all blocks in a slab to appear "misaligned"
|
||||||
// TODO: Reimplement to check stride DISTANCE between consecutive blocks
|
// TODO: Reimplement to check stride DISTANCE between consecutive blocks
|
||||||
// instead of absolute alignment to stride boundaries
|
// instead of absolute alignment to stride boundaries
|
||||||
#if 0
|
// NOTE: Disabled alignment check removed (was 47 LOC of #if 0 code)
|
||||||
do {
|
|
||||||
static _Atomic uint32_t g_next_misalign_log = 0;
|
|
||||||
extern size_t tiny_block_stride_for_class(int class_idx);
|
|
||||||
size_t stride = (class_idx >= 0 && class_idx < 8) ? tiny_block_stride_for_class(class_idx) : 0;
|
|
||||||
if (stride > 0) {
|
|
||||||
uintptr_t delta = ((uintptr_t)base) % stride;
|
|
||||||
if (__builtin_expect(delta != 0, 0)) {
|
|
||||||
void* ra = __builtin_return_address(0);
|
|
||||||
const char* sym = "(unknown)";
|
|
||||||
#ifdef __GLIBC__
|
|
||||||
do {
|
|
||||||
Dl_info info;
|
|
||||||
if (dladdr(ra, &info) && info.dli_sname) {
|
|
||||||
sym = info.dli_sname;
|
|
||||||
}
|
|
||||||
} while (0);
|
|
||||||
#endif
|
|
||||||
uint32_t n = atomic_fetch_add_explicit(&g_next_misalign_log, 1, memory_order_relaxed);
|
|
||||||
int meta_cls = -1;
|
|
||||||
int slab_idx = -1;
|
|
||||||
struct SuperSlab* ss = NULL;
|
|
||||||
if (class_idx >= 0 && class_idx < 8) {
|
|
||||||
ss = hak_super_lookup(base);
|
|
||||||
if (ss) {
|
|
||||||
slab_idx = slab_index_for(ss, base);
|
|
||||||
if (slab_idx >= 0) {
|
|
||||||
struct TinySlabMeta* m = &ss->slabs[slab_idx];
|
|
||||||
meta_cls = m->class_idx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (n < 16) {
|
|
||||||
fprintf(stderr,
|
|
||||||
"[NXT_MISALIGN] cls=%d base=%p stride=%zu delta_mod=%zu next=%p ra=%p fn=%s meta_cls=%d slab_idx=%d ss=%p\n",
|
|
||||||
class_idx, base, stride, (size_t)delta, next, ra, sym, meta_cls, slab_idx, (void*)ss);
|
|
||||||
if (n < 4) {
|
|
||||||
void* bt[8];
|
|
||||||
int frames = backtrace(bt, 8);
|
|
||||||
backtrace_symbols_fd(bt, frames, fileno(stderr));
|
|
||||||
}
|
|
||||||
fflush(stderr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (off == 0) {
|
if (off == 0) {
|
||||||
// Aligned access at base.
|
// Aligned access at base.
|
||||||
|
|||||||
Reference in New Issue
Block a user