Fix stringshare on 64bits platforms.

sizeof(Eina_Stringshare_Node) is now 24 bytes on 64bits platforms, but
str[] was pointing to before that, to the 20th byte, causing out of
bounds access.

Adding the padding will cause str[] to use the correct position. It
wastes 4 more bytes, like pre-optimizations, but it's just on big
machines.



SVN revision: 37305
This commit is contained in:
Gustavo Sverzut Barbieri 2008-10-29 14:18:29 +00:00
parent de996636ba
commit f22f587bab
1 changed files with 5 additions and 0 deletions

View File

@ -123,6 +123,11 @@ struct _Eina_Stringshare_Node
unsigned short length;
unsigned short references;
#if __WORDSIZE == 64
unsigned int __padding;
#endif
char str[];
};