ObjFW  Diff

Differences From Artifact [227edc0aad]:

  • File src/runtime/class.m — part of check-in [0e35ae63a5] at 2012-04-08 15:03:59 on branch runtime — Return Nil for incomplete classes.

    It's better to handle the class like it does not even exist in case it
    is not completely loaded. Throwing an error there introcudes trouble
    with static instances which try to get the class before initializing the
    static instances, so objc_lookup_class() should never throw an error. (user: js, size: 9246) [annotate] [blame] [check-ins using]

To Artifact [82ae92bc57]:


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <string.h>

#include <assert.h>

#import "runtime.h"
#import "runtime-private.h"

@protocol BasicClass
+ (void)load;
+ (void)initialize;
@end

static struct objc_hashtable *classes = NULL;

static void
register_class(Class cls)
{
	if (classes == NULL)
		classes = objc_hashtable_alloc(2);







<
<
<
<
<







21
22
23
24
25
26
27





28
29
30
31
32
33
34
#include <string.h>

#include <assert.h>

#import "runtime.h"
#import "runtime-private.h"






static struct objc_hashtable *classes = NULL;

static void
register_class(Class cls)
{
	if (classes == NULL)
		classes = objc_hashtable_alloc(2);