Villacaleb / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

Structure calculation size and aligment #736

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Current implementation for mapping C++ structure to C# structure is not enough 
robust. We need to implement correctly C++ compiler alignment rules for 
structure members.

Based for example on this comprehensive list : 
http://binglongx.wordpress.com/2010/05/19/alignment-and-size-of-cc-basic-and-str
ucture-types-part-of-abi/

Note that current code is generating most of the structures correctly, but in 
order to compare them with their C++ counterpart (with a C++ program outputing 
sizeof values), this part should be handled correctly.

The case for which the current code would not work is for inner structure in a 
structure that would have a different aligment (for example, a 64bit int that 
would imply the inner structure to be aligned on 8 bytes)

Original issue reported on code.google.com by alx.xo...@gmail.com on 16 Nov 2010 at 3:28

GoogleCodeExporter commented 9 years ago

Original comment by alx.xo...@gmail.com on 16 Nov 2010 at 4:00

GoogleCodeExporter commented 9 years ago

Original comment by alx.xo...@gmail.com on 17 Nov 2010 at 12:35

GoogleCodeExporter commented 9 years ago

Original comment by josh.petrie on 4 Dec 2010 at 9:51