I'm looking for malloc/free-like APIs in mainstream OSs that allow me to specify an explicit size during both allocation and de-allocation. What I hope to gain by this is that the runtime might spend less memory on bookkeeping when the allocated size is already available in the program.
On e.g. windows I only found free(), _aligned_free(), and _freea(), none of which take a second argument for size.