Re: Variables alignment
I'm new to this so I don't know much, but if I'd to say I'd guess that one reason might be performance and memory. Gcc and clang have the "aligned" attribute and in his C atomics library Jeff Preshing was using that (together with volatile). So there must be cases where it does not align.
Re: Variables alignment
As far as I know compilers always align your variables unless you specify that you have other priorities, for example with the [packed pragma](http://forum.nim-lang.org///nim-lang.org/docs/manual.html#foreign-function-interface-packed-pragma). For stack variables I don't know it, but I also don't see any reason for compilers to not align variables.
Re: Variables alignment
Krux02, from what I've read about lockfree (namely Jeff Preshing's blog: [http://preshing.com](http://forum.nim-lang.org///preshing.com)/ ), one requirement for atomics in x86 (and other architectures) are aligned variables. And about the types anything from 1 to four bytes. Araq,I have already tried that, my problem is that I can't use it inside objects nor tuples, and while I've yet to try I think I can't use it on typedefs neither. I know MSVC always align,but how do I know gcc/clang may align them, from what I've tested gcc aligns global variables.
Re: Variables alignment
Use the `codegenDecl` pragma and to generate any kind of gcc/clang annotation you need. Compilers are usually good at alignment though.
Variables alignment
Probably this has been answered before, but how I make variables aligned in Nim? I need that because for lockfree programming one of the requirements for atomic operations is that is aligned in memory. How can I do that?