3 ms·
Knowing a size and being forced to retain a size are different things. Here's a trivial example (imagine a system to process compressed audio data): (1) receiv
by kabdib 9y ago
Knowing a size and being forced to retain a size are different things. Here's a trivial example (imagine a system to process compressed audio data):
(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.
- nly 9y agoBoth 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