ObjFW  Diff

Differences From Artifact [eafb73f421]:

To Artifact [63795ddfa3]:


74
75
76
77
78
79
80
81

82
83
84
85
86
87
88

89
90

91
92
93
94
95
96
97
74
75
76
77
78
79
80

81
82
83
84
85
86
87

88
89

90
91
92
93
94
95
96
97







-
+






-
+

-
+







extern id OFForward(id, SEL, ...);
extern struct stret OFForward_stret(id, SEL, ...);
#else
# define OFForward OFMethodNotFound
# define OFForward_stret OFMethodNotFound_stret
#endif

struct pre_ivar {
struct PreIvars {
	int retainCount;
#if !defined(OF_HAVE_ATOMIC_OPS) && !defined(OF_AMIGAOS)
	OFSpinlock retainCountSpinlock;
#endif
};

#define PRE_IVARS_ALIGN ((sizeof(struct pre_ivar) + \
#define PRE_IVARS_ALIGN ((sizeof(struct PreIvars) + \
    (OF_BIGGEST_ALIGNMENT - 1)) & ~(OF_BIGGEST_ALIGNMENT - 1))
#define PRE_IVARS ((struct pre_ivar *)(void *)((char *)self - PRE_IVARS_ALIGN))
#define PRE_IVARS ((struct PreIvars *)(void *)((char *)self - PRE_IVARS_ALIGN))

static struct {
	Class isa;
} allocFailedException;

unsigned long OFHashSeed;

306
307
308
309
310
311
312
313

314
315
316
317

318
319
320
321
322
323
324
306
307
308
309
310
311
312

313
314
315
316

317
318
319
320
321
322
323
324







-
+



-
+







	    extraAlignment + extraSize);

	if OF_UNLIKELY (instance == nil) {
		allocFailedException.isa = [OFAllocFailedException class];
		@throw (id)&allocFailedException;
	}

	((struct pre_ivar *)instance)->retainCount = 1;
	((struct PreIvars *)instance)->retainCount = 1;

#if !defined(OF_HAVE_ATOMIC_OPS) && !defined(OF_AMIGAOS)
	if OF_UNLIKELY (OFSpinlockNew(
	    &((struct pre_ivar *)instance)->retainCountSpinlock) != 0) {
	    &((struct PreIvars *)instance)->retainCountSpinlock) != 0) {
		free(instance);
		@throw [OFInitializationFailedException
		    exceptionWithClass: class];
	}
#endif

	instance = (OFObject *)(void *)((char *)instance + PRE_IVARS_ALIGN);