<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 17, 2015 at 9:36 PM, Christoph Hellwig <span dir="ltr"><<a href="mailto:hch@infradead.org" target="_blank">hch@infradead.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Aug 17, 2015 at 06:23:23PM +0200, Jan Tulak wrote:<br>
> Memalign from <malloc.h> was marked obsolete in favor of a posix<br>
> variant from <stdlib.h>. So replace all calls and remove <malloc.h><br>
> includes. This also enhances support on other posix platforms,<br>
> which doesn't have <malloc.h>.<br>
><br>
> Because posix_memalign returns any error as a return code, not in<br>
> errno, change relevant checks in code (and add a missing one).<br>
<br>
</span>I have to say I hate the posix_memalign calling convention. Any chance<br>
you could just provide a memalign impementation using posix_memalign for<br>
MacOS?<br></blockquote><div><br></div><div>I thought about it. However, with memalign from malloc marked obsolete</div><div>(and with posix_memalign having guaranteed alignment restrictions [1]), I saw it better</div><div>to use the posix variant everywhere.</div><div><br></div><div>I could make a wrapper simulating the old memalign behaviour, but I don't</div><div>think it would make sense.</div><div><br></div><div>I searched for this, but didn't find any reasonable answer:</div><div>How long can be things in standard libraries marked obsolete before removing?</div><div><br></div><div>Cheers,</div><div>Jan</div><div><br></div><div>[1] man memalign:</div><div><div> On many systems there are alignment restrictions, for example, on buf‐</div><div> fers used for direct block device I/O. POSIX specifies the path‐</div><div> conf(path,_PC_REC_XFER_ALIGN) call that tells what alignment is needed.</div><div> Now one can use posix_memalign() to satisfy this requirement.</div></div><div><br></div><div><div> posix_memalign() verifies that alignment matches the requirements</div><div> detailed above. memalign() may not check that the alignment argument</div><div> is correct.</div></div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Jan Tulak<br></div><a href="mailto:jtulak@redhat.com" target="_blank">jtulak@redhat.com</a><br></div></div>
</div></div>