Tuesday, June 07, 2022

Re: aligned_alloc shouldn't require size to be a multiple of alignment

On Wed, Jun 08, 2022 at 01:15:48AM +0000, John Scott wrote:

> Hi,
>
> On OpenBSD, aligned_alloc currently fails with EINVAL if the requested
> size is not a multiple of the requested alignment. Indeed, this stems
> from a botch in the original specification in the C11 standard.
>
> See Defect Report 460 or the NetBSD man page for more details, but this
> silly requirement has been dropped in C17/C18, and I believe OpenBSD
> should conform to this. I haven't tested, but it might be sufficient to
> simply remove the check.

Of course it *might*, but can't you do better than syaing that? I'd
suggest:

- code analysis
- writing tests

-Otto

No comments:

Post a Comment