ObjFW  Check-in [0322aa3168]

Overview
Comment:Fix updating the dtable for the old GNU runtime.

Again, why does the old GNU runtime force us to fiddle with its internal
data structures instead of exporting functions?

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0322aa3168dbd8138daeca5fcd05abdd5734bb5b082d4b2a80e7177d2fb6c3ef
User & Date: js on 2011-08-03 03:38:05
Other Links: manifest | tags
Context
2011-08-03
03:53
Always use the old GNU API, even with the new GNU runtime. check-in: 546332b4d7 user: js tags: trunk
03:38
Fix updating the dtable for the old GNU runtime. check-in: 0322aa3168 user: js tags: trunk
01:55
D'oh... check-in: e8dccdf9a9 user: js tags: trunk
Changes

Modified src/OFObject.m from [1dc5e5a7d1] to [ec4f3dc978].

130
131
132
133
134
135
136

137

138
139
140
141

142
143
144


145
146
147
148
149
150
151
152
153
154
 * dtable, but the old GNU runtime is that crappy that it even forces us to
 * touch it...
 */
static void
update_dtable(Class class)
{
	MethodList_t iter;



	if (class->super_class != Nil)
		update_dtable(class->super_class);

	for (iter = class->methods; iter != NULL; iter = iter->method_next) {

		int i;

		for (i = 0; i < iter->method_count; i++)


			sarray_at_put_safe(class->dtable,
			    (sidx)iter->method_list[i].method_name->sel_id,
			    iter->method_list[i].method_imp);
	}
}
#endif

@implementation OFObject
+ (void)load
{







>

>
|
|


>



>
>
|
|
|







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
 * dtable, but the old GNU runtime is that crappy that it even forces us to
 * touch it...
 */
static void
update_dtable(Class class)
{
	MethodList_t iter;
	Class subclass;

	for (subclass = class->subclass_list; subclass != Nil;
	    subclass = subclass->sibling_class)
		update_dtable(subclass);

	for (iter = class->methods; iter != NULL; iter = iter->method_next) {
		Method_t methods = iter->method_list;
		int i;

		for (i = 0; i < iter->method_count; i++)
			if (sarray_get_safe(class->dtable,
			    (sidx)methods[i].method_name->sel_id) != NULL)
				sarray_at_put_safe(class->dtable,
				    (sidx)methods[i].method_name->sel_id,
				    methods[i].method_imp);
	}
}
#endif

@implementation OFObject
+ (void)load
{