ObjFW  Diff

Differences From Artifact [ceb0d6303e]:

To Artifact [3c88a5e1a9]:

  • File src/runtime/runtime-private.h — part of check-in [84a724dd4b] at 2013-12-06 00:52:26 on branch trunk — Add a fast path for objc_classname_to_class().

    This should improve the performance for the GCC ABI, as
    objc_classname_to_class() is used for all sorts of class lookups, e.g.
    objc_lookup_class().

    As this performance improvement needs RAM, it is only used after 128
    calls into objc_classname_to_class(), so that if the ObjFW ABI is used
    and the user does not call into objc_getClass() or similar in a loop, no
    memory is wasted.

    Runtime internal usage of objc_classname_to_class() does not use the
    fast path and does not count as a call into objc_classname_to_class().
    The reason for this is that if the runtime calls
    objc_classname_to_class(), it already has the lock and thus the
    performance gain would be small, but it would waste memory. (user: js, size: 5194) [annotate] [blame] [check-ins using]


122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

extern void objc_register_all_categories(struct objc_abi_symtab*);
extern struct objc_category** objc_categories_for_class(Class);
extern void objc_free_all_categories(void);
extern void objc_initialize_class(Class);
extern void objc_update_dtable(Class);
extern void objc_register_all_classes(struct objc_abi_symtab*);
extern Class objc_classname_to_class(const char*);
extern void objc_free_class(Class);
extern void objc_free_all_classes(void);
extern uint32_t objc_hash_string(const char*);
extern struct objc_hashtable* objc_hashtable_new(uint32_t);
extern void objc_hashtable_set(struct objc_hashtable*, const char*,
    const void*);
extern void* objc_hashtable_get(struct objc_hashtable*, const char*);







|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

extern void objc_register_all_categories(struct objc_abi_symtab*);
extern struct objc_category** objc_categories_for_class(Class);
extern void objc_free_all_categories(void);
extern void objc_initialize_class(Class);
extern void objc_update_dtable(Class);
extern void objc_register_all_classes(struct objc_abi_symtab*);
extern Class objc_classname_to_class(const char*, bool);
extern void objc_free_class(Class);
extern void objc_free_all_classes(void);
extern uint32_t objc_hash_string(const char*);
extern struct objc_hashtable* objc_hashtable_new(uint32_t);
extern void objc_hashtable_set(struct objc_hashtable*, const char*,
    const void*);
extern void* objc_hashtable_get(struct objc_hashtable*, const char*);