系统、硬件与 FFI
What the canary check looks like at -O2
Three small C functions, gcc -O2 -fstack-protector-strong -S -masm=intel, x86-64 Linux. read_line and read_count get the same…
Callbacks from C lose the arena I set up
A C library calls back into my Odin code, and the callback can't see the context I set up before registering it. A proc "c" g…
Clearing one status flag with |= cleared all of them
|= on a write-1-to-clear status register clears more than the bit you named. The overrun flag clears by writing 1 to it. Writ…
Unwrapping a C pointer with .? is an assertion
.? on a pointer that came back from C is an assertion, not a check. It says null is impossible here. In a safety-checked buil…
Notes on a buffer that expires at the next call
A C library hands back a pointer and a length. What's known so far. For a single-threaded call sequence the buffer is readabl…
Tcl_Obj shimmering and interpreter threads
The C side of embedding Tcl fits on a postcard. Tcl_CreateInterp, Tcl_EvalObjEx, Tcl_GetObjResult, and everything that crosse…
volatile buys less than most drivers assume
Reading a UART driver again and the same pattern shows up. status is a volatile uint32_t * aimed at the status register, the…