[M3devel] computing a typeid in backend for a pointer to a declared type??

Jay K jay.krell at cornell.edu
Sun Apr 7 07:56:29 CEST 2013


In the C backend, I would like to share code for records and objects.


As I understand, objects are always pointers.


In my framework, I map typeids to type information.


For this to work, given an object, I need to declare both a record
and a pointer to it. I need two typeids for that.


I'm in the position where I need to compute a typeid.
Is that feasible?



I have two choices if I can't do that:


 1) map from strings instead, where the strings tend to be
    a string form of a typeid, but where I can make up other forms;
    quite an inefficiency


 1b) have two maps maybe



 2) build a flag into my record data that indicates "record or object"


#1 is easy but I'm leary of the inefficiency.
I'll probably try #2 instead then.



 - Jay


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20130407/faa63519/attachment-0001.html>


More information about the M3devel mailing list