points by wahern 3 days ago | 0 comments
C2y has already added free_sized, FWIW, which is symmetrical with malloc. See 7.25.4.7 in the latest draft at https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3998.pdf
It also adds free_aligned_sized as the counterpart to C11's aligned_alloc. Though while you can pass memory from aligned_alloc to free, you can't use free_sized or free_aligned_sized with aligned_alloc'd or malloc'd memory respectively, a potential (and unavoidable?) foot gun.
[–] dooglius 3 days ago
[–] wahern 3 days ago
But, yeah, it's not an ideal situation from the perspective of free_aligned advocates.
[–] 1718627440 3 days ago