lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Philippe:

On Sat, May 16, 2020 at 1:48 AM Philippe Verdy <verdyp@gmail.com> wrote:
> THat's the trick they used to avoid bugs: overaligning when it is not needed.

No, they did not. malloc(3) states "The  malloc() and calloc()
functions return a pointer to the allocated memory, which is suitably
aligned for any built-in type.". They MUST overalign. C malloc is not
a pink unicorn whose mission is to somehow predict what you are using
the memory for, its mission is to obey the rules.

> But using a static alignment to some fixed multiple (e.g. 8), which porove to be insufficient (e.g. for requesting pagesize alignment).

Again, nothing says malloc must be able to return page aligned more.
AAMOF, nothing in the C standard requires the processor to have
"pages", I've worked with machines without pages, and I'm nearly
convinced you have too. Do you ever read the language definitions?

Francisco Olarte.
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org