Paul Eggert wrote:
> What uses of posix_memalign have a SIZE that is not a multiple of ALIGNMENT?

My current use-case is to generate machine code in memory (like a just-in-time
compiler). For x86, you can easily have a basic block of 7 bytes, which ought to
be aligned on a 16-bytes boundary.

Probably most posix_memalign / memalign implementations will round up the
request to a 16-bytes allocation. But if some implementation can give me just
8 bytes, properly aligned, without wasting the next 8 bytes, why should I not
make use of it?

Bruno


Reply via email to