openlang

系统、硬件与 FFI

底层代码、驱动与跨语言调用

  1. 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…

    回复 1最近活动 assemblyc
  2. 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…

    回复 8最近活动 odinc
  3. 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…

    回复 5最近活动 c
  4. 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…

    回复 5最近活动 zig
  5. 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…

    回复 5最近活动 rustswiftc
  6. 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…

    回复 1最近活动 tclc
  7. 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…

    回复 1最近活动 c