ObjFW  Diff

Differences From Artifact [d8ad2314c9]:

To Artifact [88eeb2453d]:


376
377
378
379
380
381
382
383
384
385
386
387


388

389

390
391

392
393
394
395
396
397
398
376
377
378
379
380
381
382


383
384
385
386
387

388

389
390

391
392
393
394
395
396
397
398







-
-



+
+
-
+
-
+

-
+







		extraAlignment = OFRoundUpToPowerOf2(extraAlignment,
		    PRE_IVARS_ALIGN + instanceSize) -
		    PRE_IVARS_ALIGN - instanceSize;

#if defined(OF_WINDOWS)
	instance = __mingw_aligned_malloc(PRE_IVARS_ALIGN + instanceSize +
	    extraAlignment + extraSize, OF_BIGGEST_ALIGNMENT);
	memset(instance, 0, PRE_IVARS_ALIGN + instanceSize + extraAlignment +
	    extraSize);
#elif defined(OF_MSDOS)
	instance = alignedAlloc(PRE_IVARS_ALIGN + instanceSize +
	    extraAlignment + extraSize, OF_BIGGEST_ALIGNMENT, &offset);
#elif defined(OF_SOLARIS)
	if (posix_memalign((void **)&instance, OF_BIGGEST_ALIGNMENT,
	memset(instance, 0, PRE_IVARS_ALIGN + instanceSize + extraAlignment +
	    PRE_IVARS_ALIGN + instanceSize + extraAlignment + extraSize) != 0)
	    extraSize);
		instance = NULL;
#else
	instance = calloc(1, PRE_IVARS_ALIGN + instanceSize +
	instance = malloc(PRE_IVARS_ALIGN + instanceSize +
	    extraAlignment + extraSize);
#endif

	if OF_UNLIKELY (instance == nil) {
		object_setClass((id)&allocFailedException,
		    [OFAllocFailedException class]);
		@throw (id)&allocFailedException;
415
416
417
418
419
420
421


422
423
424
425
426
427
428
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430







+
+







# endif
		@throw [OFInitializationFailedException
		    exceptionWithClass: class];
	}
#endif

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

	memset(instance, 0, instanceSize + extraAlignment + extraSize);

	if (!objc_constructInstance(class, instance)) {
#if !defined(OF_HAVE_ATOMIC_OPS) && !defined(OF_AMIGAOS)
		OFSpinlockFree(&((struct PreIvars *)(void *)
		    ((char *)instance - PRE_IVARS_ALIGN))->retainCountSpinlock);
#endif
#if defined(OF_WINDOWS)