Differences From Artifact [d8ad2314c9]:
- File src/OFObject.m — part of check-in [7413a728a7] at 2024-04-03 02:16:03 on branch trunk — Change license to LGPLv3 only (user: js, size: 30513) [annotate] [blame] [check-ins using]
To Artifact [88eeb2453d]:
- File
src/OFObject.m
— part of check-in
[f6afff33eb]
at
2024-04-09 19:35:13
on branch trunk
— OFObject: Use posix_memalign() on Solaris
In 32 bit mode, malloc() doesn't always return pointers correctly
aligned for SSE. (user: js, size: 30579) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
376 377 378 379 380 381 382 | 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); | < < > > | < > | | 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); #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, PRE_IVARS_ALIGN + instanceSize + extraAlignment + extraSize) != 0) instance = NULL; #else 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 | # endif @throw [OFInitializationFailedException exceptionWithClass: class]; } #endif instance = (OFObject *)(void *)((char *)instance + PRE_IVARS_ALIGN); 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) | > > | 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) |
︙ | ︙ |