32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
static const uint32_t maxSel = 0xFFFFFF;
static const uint8_t selLevels = 3;
#else
static const uint32_t maxSel = 0xFFFF;
static const uint8_t selLevels = 2;
#endif
static struct _objc_hashtable *selectors = NULL;
static uint32_t selectorsCount = 0;
static struct _objc_sparsearray *selectorNames = NULL;
static void **freeList = NULL;
static size_t freeListCount = 0;
void
_objc_registerSelector(struct _objc_selector *selector)
{
SEL existingSelector;
const char *name;
if (selectorsCount > maxSel)
_OBJC_ERROR("Out of selector slots!");
|
|
|
|
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
static const uint32_t maxSel = 0xFFFFFF;
static const uint8_t selLevels = 3;
#else
static const uint32_t maxSel = 0xFFFF;
static const uint8_t selLevels = 2;
#endif
static struct objc_hashtable *selectors = NULL;
static uint32_t selectorsCount = 0;
static struct objc_sparsearray *selectorNames = NULL;
static void **freeList = NULL;
static size_t freeListCount = 0;
void
_objc_registerSelector(struct objc_selector *selector)
{
SEL existingSelector;
const char *name;
if (selectorsCount > maxSel)
_OBJC_ERROR("Out of selector slots!");
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
_objc_sparsearray_set(selectorNames, (uint32_t)selector->UID,
(void *)name);
}
SEL
sel_registerName(const char *name)
{
struct _objc_selector *selector;
_objc_globalMutex_lock();
if (selectors != NULL &&
(selector = _objc_hashtable_get(selectors, name)) != NULL) {
_objc_globalMutex_unlock();
return (SEL)selector;
|
|
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
_objc_sparsearray_set(selectorNames, (uint32_t)selector->UID,
(void *)name);
}
SEL
sel_registerName(const char *name)
{
struct objc_selector *selector;
_objc_globalMutex_lock();
if (selectors != NULL &&
(selector = _objc_hashtable_get(selectors, name)) != NULL) {
_objc_globalMutex_unlock();
return (SEL)selector;
|
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
_objc_registerSelector(selector);
_objc_globalMutex_unlock();
return (SEL)selector;
}
void
_objc_registerAllSelectors(struct _objc_symtab *symtab)
{
struct _objc_selector *selector;
if (symtab->selectorRefs == NULL)
return;
for (selector = symtab->selectorRefs; selector->UID != 0; selector++)
_objc_registerSelector(selector);
}
|
|
|
|
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
_objc_registerSelector(selector);
_objc_globalMutex_unlock();
return (SEL)selector;
}
void
_objc_registerAllSelectors(struct objc_symtab *symtab)
{
struct objc_selector *selector;
if (symtab->selectorRefs == NULL)
return;
for (selector = symtab->selectorRefs; selector->UID != 0; selector++)
_objc_registerSelector(selector);
}
|