Re:The Horror in the Standard Library
by nly on Saturday May 06, 2017 @03:43PM
(#14281885)
Both your speaker driver and your application code still needed to keep track of the buffer size. calling free(size) on your buffer would require no extra overhead
(1) receive packet: compute actual size, allocate buffer, expand data into it, start DMA to a speaker or something
(2) DMA-done: free the buffer
There, I didn't need the size on the free. There are many, many many similar cases, in fact these cases probably dominate.