The Memory Layout of Rust Enums: Discriminants, Niche Optimization, and AlignmentRust enum sizing equals the largest variant payload plus discriminant and trailing alignment padding. Ignoring variant balance bloats hot collections, blowing past L1 cache boundaries. Exploiting invaOct 2 · 7 min readsufyanism.hashnode.dev
What Happens to the CPU Cache During sched_yieldYielding CPU execution via sched_yield() introduces catastrophic tail latency by forcing kernel register spills, Translation Lookaside Buffer evictions, and L1/L2 cache pollution. Voluntary thread swiSep 28 · 7 min readsufyanism.hashnode.dev
Dissecting the Rust Vtable: Dynamic Dispatch vs. Monomorphization in AssemblyDynamic dispatch via fat pointers imposes a double dereference penalty, prevents LLVM compiler inlining passes, and degrades CPU Branch Target Buffer throughput under polymorphic workloads, whereas geSep 24 · 6 min readsufyanism.hashnode.dev
Why fork() Doesn't Duplicate Memory: Copy-on-Write and the Page Tablefork() relies on Copy-on-Write (COW) by duplicating page table hierarchies while marking physical pages read-only. When child or parent processes write to dense memory states, the resulting cascade ofSep 21 · 8 min readsufyanism.hashnode.dev
What std::mem::forget Actually Does to Heap Allocations?std::mem::forget drops the stack-allocated handle without executing Drop glue, permanently orphaning heap metadata within allocator arenas. It guarantees the absence of Undefined Behavior by design, wSep 17 · 8 min readsufyanism.hashnode.dev