News for hackers. Stuff that matters.
Re:Arena Allocator Tips and Tricks by matheusmoreira on Wednesday September 27, 2023 @06:29AM (#37672731)
The compiler knows the size of statically allocated buffers and can be told about alignments with:

  __attribute__((aligned(N)))
  __builtin_assume_aligned(P, N)
Is this information sufficient for correct code generation?
Re:Arena Allocator Tips and Tricks by LoganDark on Wednesday September 27, 2023 @09:24AM (#37674321)
No, because strict aliasing doesn't allow the compiler to magically decide that someplace you are writing happens to be in a statically allocated buffer. Strict aliasing says you have a pointer of some type and what you do with it has to agree with the type of that pointer. That's the "strict" in it.