Re: core.stdc.stdlib.malloc & alignment

2016-06-28 Thread captaindet via Digitalmars-d-learn
On 2016-06-29 14:39, Hiemlick Hiemlicker wrote: Yes, the C standard requires malloc to be aligned to the platform size(4 for 32bit, 8 for 64-bit). just what i was hopping for. thanks!

Re: core.stdc.stdlib.malloc & alignment

2016-06-28 Thread Hiemlick Hiemlicker via Digitalmars-d-learn
On Wednesday, 29 June 2016 at 02:24:55 UTC, captaindet wrote: is there an alignment guarantee for core.stdc.stdlib.malloc? more specifically, using DMD and compiling for 32bit on windows, can i assume proper alignment for int or uint variables? background: i like to re-use a (ubyte) buffer,

core.stdc.stdlib.malloc & alignment

2016-06-28 Thread captaindet via Digitalmars-d-learn
is there an alignment guarantee for core.stdc.stdlib.malloc? more specifically, using DMD and compiling for 32bit on windows, can i assume proper alignment for int or uint variables? background: i like to re-use a (ubyte) buffer, sometimes it will store only bytes, sometimes it shall store