Differences From Artifact [11d1996c9a]:
- File
src/runtime/category.m
— part of check-in
[2a27cf3000]
at
2016-01-03 00:41:26
on branch trunk
— Update copyright
While at it, also update the mail address. (user: js, size: 3270) [annotate] [blame] [check-ins using] [more...]
To Artifact [95abd1e8f7]:
- File src/runtime/category.m — part of check-in [e0b9167693] at 2016-02-21 15:37:42 on branch trunk — Make use of C99-style for loops (user: js, size: 3300) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
24 25 26 27 28 29 30 | #import "runtime-private.h" static struct objc_hashtable *categories = NULL; static void register_selectors(struct objc_abi_category *cat) { | | < < | | > | | | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #import "runtime-private.h" static struct objc_hashtable *categories = NULL; static void register_selectors(struct objc_abi_category *cat) { for (struct objc_abi_method_list *ml = cat->instance_methods; ml != NULL; ml = ml->next) for (unsigned int i = 0; i < ml->count; i++) objc_register_selector( (struct objc_abi_selector*)&ml->methods[i]); for (struct objc_abi_method_list *ml = cat->class_methods; ml != NULL; ml = ml->next) for (unsigned int i = 0; i < ml->count; i++) objc_register_selector( (struct objc_abi_selector*)&ml->methods[i]); } static void register_category(struct objc_abi_category *cat) { |
︙ | ︙ | |||
91 92 93 94 95 96 97 | objc_update_dtable(cls->isa); } } void objc_register_all_categories(struct objc_abi_symtab *symtab) { | | < < | | < < | | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | objc_update_dtable(cls->isa); } } void objc_register_all_categories(struct objc_abi_symtab *symtab) { struct objc_abi_category **cats = (struct objc_abi_category**)symtab->defs + symtab->cls_def_cnt; for (size_t i = 0; i < symtab->cat_def_cnt; i++) { register_selectors(cats[i]); register_category(cats[i]); } } struct objc_category** objc_categories_for_class(Class cls) { if (categories == NULL) return NULL; return (struct objc_category**)objc_hashtable_get(categories, cls->name); } void objc_unregister_all_categories(void) { if (categories == NULL) return; for (uint32_t i = 0; i < categories->size; i++) if (categories->data[i] != NULL) free((void*)categories->data[i]->obj); objc_hashtable_free(categories); categories = NULL; } |