ObjFW  Check-in [7bbd6e43fe]

Overview
Comment:Move objc_classname_to_class.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | runtime
Files: files | file ages | folders
SHA3-256: 7bbd6e43fe39bcd5992782be4a8cd37cc7d5311cc11baf6c8bf2d81c51395219
User & Date: js on 2012-04-21 12:52:13
Other Links: branch diff | manifest | tags
Context
2012-04-21
13:04
Avoid useless looking for +[load] method. check-in: c03268e4c6 user: js tags: runtime
12:52
Move objc_classname_to_class. check-in: 7bbd6e43fe user: js tags: runtime
11:31
Merge branch 'master' into runtime check-in: 676e09bf77 user: js tags: runtime
Changes

Modified src/runtime/class.m from [a1cee08383] to [59d640393e].

45
46
47
48
49
50
51















52
53
54
55
56
57
58
	unsigned int i;

	for (ml = cls->methodlist; ml != NULL; ml = ml->next)
		for (i = 0; i < ml->count; i++)
			objc_register_selector(
			    (struct objc_abi_selector*)&ml->methods[i]);
}
















static void
call_method(Class cls, const char *method)
{
	struct objc_method_list *ml;
	SEL selector;
	unsigned int i;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
	unsigned int i;

	for (ml = cls->methodlist; ml != NULL; ml = ml->next)
		for (i = 0; i < ml->count; i++)
			objc_register_selector(
			    (struct objc_abi_selector*)&ml->methods[i]);
}

inline Class
objc_classname_to_class(const char *name)
{
	Class c;

	if (classes == NULL)
		return Nil;

	objc_global_mutex_lock();
	c = (Class)objc_hashtable_get(classes, name);
	objc_global_mutex_unlock();

	return c;
}

static void
call_method(Class cls, const char *method)
{
	struct objc_method_list *ml;
	SEL selector;
	unsigned int i;
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310

			if (load_queue == NULL)
				ERROR("Not enough memory for load queue!");
		}
	}
}

inline Class
objc_classname_to_class(const char *name)
{
	Class c;

	if (classes == NULL)
		return Nil;

	objc_global_mutex_lock();
	c = (Class)objc_hashtable_get(classes, name);
	objc_global_mutex_unlock();

	return c;
}

inline Class
objc_lookup_class(const char *name)
{
	Class cls = objc_classname_to_class(name);

	if (cls == NULL)
		return Nil;







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







297
298
299
300
301
302
303















304
305
306
307
308
309
310

			if (load_queue == NULL)
				ERROR("Not enough memory for load queue!");
		}
	}
}
















inline Class
objc_lookup_class(const char *name)
{
	Class cls = objc_classname_to_class(name);

	if (cls == NULL)
		return Nil;