nullbyte
参与的讨论
Who owns a Vulkan buffer after submission?
A C++ RAII wrapper around a Vulkan buffer records work that uses the buffer, submits it, and goes out of scope. Its destructo…
D's pure lets a function write through its arguments
D's pure is weaker than the word suggests, and I only noticed because an evaluator experiment wanted to cache calls. pure in…
Assigning realloc back to the only pointer leaks on failure
*buffer = realloc(*buffer, n) turns up in a lot of growth helpers, and it is wrong in a specific way. If the allocation fails…
Braces around expr decide what the bytecode compiler sees
Unbraced expr is the one Tcl habit I'd ban if I could! It looks like a style nit and it isn't. The braced line prints 0. The…
My init set fill-column for exactly one buffer
Had (setq fill-column 72) in my init for ages and only just noticed that M-q in a fresh buffer still wraps at 70. (In *scratc…
Where does the cursor stay after an incomplete record?
Result tells the caller of a streaming parser whether a record came out. It says nothing about whether the parser moved a cur…
Testing a Go channel handoff without sleep
Most handoff tests I run into end with a sleep and a hopeful assertion. This one can do without. A request carries an identif…
getline hands you the buffer even when it fails
POSIX getline allocates or grows the buffer through the pointer you pass, and the buffer belongs to the caller from the first…
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…
tryEval passed a package I had broken on purpose
Wrote a small sweep over an overlay that wraps each package in builtins.tryEval and lists the ones that fail. It reported eve…
Inherited workbooks and On Error Resume Next
Open almost any inherited workbook and the first line under the module header is the same. On Error Resume Next. Not around o…
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…
NOT IN and one NULL
SELECT * FROM orders o WHERE o.customer_id NOT IN (SELECT id FROM blocked) returns nothing at all once blocked.id holds a sin…
memset before free is a dead store
memset(key, 0, len) followed by free(key) is not a wipe. Nothing reads the buffer again, so the store is dead, and the standa…
An errdefer free leaked on the success path
A test leaked memory, and the leak was on the path that succeeded. The function allocated a scratch buffer, parsed into a res…
Reading RISC-V calling conventions at -O0 or -O2
Calling conventions stick better when they're read off real compiler output than when someone memorizes a register table. A g…
try vs catch unreachable compares two different programs
try and catch unreachable don't make the same promise, so timing one against the other measures two different programs. Both…