Closed mikbras closed 1 year ago
@jxyang: Thank you for your review. I committed changes to the comments to clarify that the footer is aligned. Also, I am on the fence about whether to remove the V1 function. For now, I left it as a cross check in the unlikely event that V1 and V2 don't produce the same result. :)
This patch fixes a bug in musl libc
memalign
when using debug-malloc. The functionmyst_debug_posix_memalign()
was calling into musl'smemalign
function, which was calling back intomyst_debug_malloc()
, which would have resulted in a double debug-malloc header and trailer. Consequently,free()
crashed when releasing memory obtained withmemalign()
.