|
From: Roger H. <rog...@mi...> - 2005-01-24 13:23:42
|
I have now completed the change to use a hierarchy of C++ classes so that the instance data of each Quesa object is allocated as a single block of memory. In CodeWarrior the class hierarchy window now shows the full tree of Quesa'a built in classes. I seek your input on what I have done and in particular could the versions for other platforms and even the Macho target for Mac be tested please. I suspect the problem with the 'Dump' code has sorted itself out, but could this be checked too please. For my remaining 'slack' time I would like your opinions on the possible use of C++ memory allocation and construction facilities. On Macintosh I think that using statements like: E3ClassInfo* theInfo = new E3ClassInfo ; E3ClassInfo* theClass = (E3ClassInfo*) Q3Memory_AllocateClear ( sizeof ( E3ClassInfo ) ) ; are (except for the zeroing of the block of memory) equivalent as they both end up calling malloc to actually reserve the memory. Am I correct, and what is the situation on the other platforms? The other thing I would like to bring forward from the faster Microspot version of Quesa is the elimination of the hash table search for methods each time they are used. I had originally hoped to use proper C++ virtual methods as these are exactly what Quesa is doing, but collective wisdom was that this was a bad move. An alternative is to replicate the class tree of the instance data with one which has ClassInfo at its root. Then there could be pointers to the member functions introduced at each level of the hierarchy, and these could be initialised with a call to E3ClassInfo::Find_Method which would find the appropriate method (by calling the meta handler for the class and if necessary each of its parents until it finds a method) in exactly the same way as is done now when a method is not found in the hash table. Your opinions please so I can get on with one or both of these if they are felt desirable. Roger. |