Differences From Artifact [5540d87e86]:
- File
src/runtime/static-instances.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: 2535) [annotate] [blame] [check-ins using] [more...]
To Artifact [dbfe4cc308]:
- File src/runtime/static-instances.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: 2501) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
25 26 27 28 29 30 31 | static struct objc_abi_static_instances **static_instances = NULL; static size_t static_instances_cnt = 0; void objc_init_static_instances(struct objc_abi_symtab *symtab) { struct objc_abi_static_instances **si; | < | < < | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | static struct objc_abi_static_instances **static_instances = NULL; static size_t static_instances_cnt = 0; void objc_init_static_instances(struct objc_abi_symtab *symtab) { struct objc_abi_static_instances **si; /* Check if the class for a static instance became available */ for (size_t i = 0; i < static_instances_cnt; i++) { Class cls = objc_lookUpClass(static_instances[i]->class_name); if (cls != Nil) { for (id *instances = static_instances[i]->instances; *instances != nil; instances++) object_setClass(*instances, cls); static_instances_cnt--; if (static_instances_cnt == 0) { free(static_instances); |
︙ | ︙ | |||
69 70 71 72 73 74 75 | if (si == NULL) return; for (; *si != NULL; si++) { Class cls = objc_lookUpClass((*si)->class_name); if (cls != Nil) { | < < | | | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | if (si == NULL) return; for (; *si != NULL; si++) { Class cls = objc_lookUpClass((*si)->class_name); if (cls != Nil) { for (id *instances = (*si)->instances; *instances != nil; instances++) object_setClass(*instances, cls); } else { static_instances = realloc(static_instances, sizeof(struct objc_abi_static_instances*) * (static_instances_cnt + 1)); if (static_instances == NULL) |
︙ | ︙ |