On Wed, 29 Sep 2021 14:25:09 +0200 Toke Høiland-Jørgensen wrote: > >> I guess we could play some trickery with stuffing offset/len/flags into > >> one or two u64s to save an argument or two? > > > > Adding another pointer arg seems really hard to explain as an API. > > What happens if I pass the "wrong" ptr? What happens if I pass NULL? > > > > How about this: instead of taking stack_ptr, take the return value > > from header_pointer as an argument. > > Hmm, that's a good point; I do think that passing the return value from > header pointer is more natural as well (you're flushing pointer you just > wrote to, after all). It is more natural but doesn't allow for the same level of optimization. Wouldn't consistent naming obviate the semantics?