Dechenjm / crack-language

Automatically exported from code.google.com/p/crack-language
Other
0 stars 0 forks source link

Rework the extension API to better deal with alignment issues #49

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The extension library now allows you to compose crack classes and map them to 
an underlying structure in C or C++.  Unfortunately, this doesn't work very 
well because the alignments used by the crack compiler and the C/C++ compiler 
can vary.

We need a way to be able to fix alignment from both sides: on the crack side, 
the extension library's addInstVar() method should be modified to provide an 
offset and field accessors need to be able to accomodate operators so we can 
generate field accesss instructions as references to these offsets.

On the C/C++ side, we need to be able to generate headers with the appropriate 
padding that are platform/compiler/options specific - so an extension structure 
can inherit from crack::ext::Object with the intended consequences. 

Original issue reported on code.google.com by mind...@gmail.com on 20 Oct 2010 at 11:56

GoogleCodeExporter commented 9 years ago

Original comment by mind...@gmail.com on 20 Oct 2010 at 11:57

GoogleCodeExporter commented 9 years ago

Original comment by mind...@gmail.com on 7 Jun 2011 at 9:02

GoogleCodeExporter commented 9 years ago
Member access by offset is fixed in rev bfde619d6c10.  Leaving this bug open to 
address inheritance, though I'm not sure we want to do inheritance of extension 
types in this way. 

Original comment by mind...@gmail.com on 5 Sep 2011 at 4:08