Re:Why I rewrote my Rust keyboard firmware in Zig: consisten...
by glandium on Sunday March 07, 2021 @06:46PM
(#26380919)
I actually did misunderstand. I thought it allowed callers to give an allocator and the callees didn't have to know for it to be used.
Re:Why I rewrote my Rust keyboard firmware in Zig: consisten...
by yellowapple on Sunday March 07, 2021 @10:10PM
(#26381975)
I mean, I'd say you were mostly right, in the sense that the callee doesn't know the implementation details of the passed allocator; it's only aware of the interface (i.e. the struct of function pointers that defines that interface).
BufWrite would do it the same as any data structure would, an additional parameter, all the same.