[Rd] Why does an empty vector occupy 40 bytes?

Hadley Wickham h.wickham at gmail.com
Thu Aug 29 21:26:29 CEST 2013

>> Do pointers always have to be aligned?
> Depends on the architecture, e.g., Sparc doesn't allow non-aligned pointers at all (results in a segfault), SV x86_64 ABI specifies pointers to be aligned at 8 bytes, but the x86_64 CPUs will allow misaligned pointers with a performance penalty (the same was true for x86 - i.e. misaligned pointers are tolerated with a penalty).

Ok, so you might not have to align pointers a particular architecture,
but if you're writing code that you want to work across multiple
architectures you must.


Chief Scientist, RStudio

More information about the R-devel mailing list