Review Board

1.0

Maintain subclass list when dealing with hidden classes

Updated 1 year, 5 months ago

Truls Becken Reviewers
EtoileCore
None Etoile trunk (etoile/trunk/Etoile)
Maintain the subclass list when creating / destroying hidden classes, so that updating the dtable works recusively.

Some lines were reorganized to make the class and metaclass construction code more similar (easier to read).

Other than that, the class for the meta class was set wrongly. It should be that of Object's meta class, which means that all meta classes have the same class, so cls->class_pointer->class_pointer should be correct.

 
Ship it!
Posted 1 year, 5 months ago (March 15th, 2009, 9:23 a.m.)
Looks good.  Please commit.
Can't you add the new class at the head of this list, instead of the tail, and avoid this loop?
  1. Yes, you are right, it now becomes so simple it's not even funny. :)
Is there not a CLS_SETMETA() macro you should use here?  If not, please add one with the CLS_SETHIDDEN() one.
  1. I'm not so sure about this. Header objc-api.h seems to deliberately not add it. Unlike other flags, _CLS_META and _CLS_CLASS don't need to be or'd with anything as they are the initial values.
    
    Also, I just checked, and this is how it's done in function GSObjCMakeClass (gnustep-base Source/Additions/GSObjCRuntime.m)
Same here.  CLS_SETCLASS() (Possibly doesn't exist; add it if not)