count = 0;
state = NXInitHashState (table);
while (NXNextHashState (table, &state, (void **) &data))
- printf ("class %d: %s\n", ++count, data->getName());
+ printf ("class %d: %s\n", ++count, data->nameForLogging());
}
return 0;
// Call through to real hash function
- return _objc_strhash (data->getName());
+ return _objc_strhash (data->mangledName());
}
/***********************************************************************
static int classIsEqual(void *info, Class name, Class cls)
{
// Standard string comparison
- return strcmp(name->getName(), cls->getName()) == 0;
+ return strcmp(name->mangledName(), cls->mangledName()) == 0;
}
}
+/***********************************************************************
+* objc_getFutureClass. Return the id of the named class.
+* If the class does not exist, return an uninitialized class
+* structure that will be used for the class when and if it
+* does get loaded.
+* Not thread safe.
+**********************************************************************/
+Class objc_getFutureClass(const char *name)
+{
+ Class cls;
+
+ // YES unconnected, NO class handler
+ // (unconnected is OK because it will someday be the real class)
+ cls = look_up_class(name, YES, NO);
+ if (cls) {
+ if (PrintFuture) {
+ _objc_inform("FUTURE: found %p already in use for %s",
+ (void*)cls, name);
+ }
+ return cls;
+ }
+
+ // No class or future class with that name yet. Make one.
+ // fixme not thread-safe with respect to
+ // simultaneous library load or getFutureClass.
+ return _objc_allocateFutureClass(name);
+}
+
+
/***********************************************************************
* objc_setFutureClass.
* Like objc_getFutureClass, but uses the provided memory block.
// the only version number used on Mac OS X was 2.
// gcc (10.5 and later) uses isa field for ext pointer
- if (version < PAGE_SIZE) {
+ if (version < 4096 /* not PAGE_SIZE */) {
return NO;
}