On 19 August 2013 14:20, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 2013-08-19 13:53, schrieb Henri Verbeet:
That's actually a bug in what I posted.
What's your suggested fix? Allocating size + align + alignment, and adding alignment to mem if mem happens to be already aligned?
I think it needs to be "align = max(sizeof(*p), alignment);", but that's actually for the aligned + 1 case.
I think we can always add some extra padding in the caller if it turns out to be needed, but I'm tempted to not worry too much about it, since it could very well be that the original comment was actually about alignment, and a regression test should give pretty obvious results if this breaks something.