@@ -59,7 +59,7 @@ struct __CFAllocator {
59
59
};
60
60
61
61
CF_INLINE uintptr_t __CFISAForCFAllocator (void ) {
62
- return __CFRuntimeObjCClassTable [ _kCFRuntimeIDCFAllocator ] ;
62
+ return _GetCFRuntimeObjcClassAtIndex ( _kCFRuntimeIDCFAllocator ) ;
63
63
}
64
64
65
65
CF_INLINE CFAllocatorRetainCallBack __CFAllocatorGetRetainFunction (const CFAllocatorContext * context ) {
@@ -478,7 +478,7 @@ void CFAllocatorSetDefault(CFAllocatorRef allocator) {
478
478
}
479
479
#endif
480
480
#if TARGET_OS_MAC
481
- if (allocator && allocator -> _base . _cfisa != __CFISAForCFAllocator ()) { // malloc_zone_t *
481
+ if (allocator && _CFTypeGetClass ( allocator ) != __CFISAForCFAllocator ()) { // malloc_zone_t *
482
482
return ; // require allocator to this function to be an allocator
483
483
}
484
484
#endif
@@ -505,7 +505,7 @@ static CFAllocatorRef __CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorC
505
505
CFAllocatorAllocateCallBack allocateFunc ;
506
506
void * retainedInfo ;
507
507
#if TARGET_OS_MAC
508
- if (allocator && kCFAllocatorUseContext != allocator && allocator -> _base . _cfisa != __CFISAForCFAllocator ()) { // malloc_zone_t *
508
+ if (allocator && kCFAllocatorUseContext != allocator && _CFTypeGetClass ( allocator ) != __CFISAForCFAllocator ()) { // malloc_zone_t *
509
509
return NULL ; // require allocator to this function to be an allocator
510
510
}
511
511
#endif
@@ -588,15 +588,15 @@ void *CFAllocatorAllocate(CFAllocatorRef allocator, CFIndex size, CFOptionFlags
588
588
}
589
589
590
590
#if defined(DEBUG ) && TARGET_OS_MAC
591
- if (allocator -> _base . _cfisa == __CFISAForCFAllocator ()) {
591
+ if (_CFTypeGetClass ( allocator ) == __CFISAForCFAllocator ()) {
592
592
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
593
593
}
594
594
#else
595
595
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
596
596
#endif
597
597
if (0 == size ) return NULL ;
598
598
#if TARGET_OS_MAC
599
- if (allocator -> _base . _cfisa != __CFISAForCFAllocator ()) { // malloc_zone_t *
599
+ if (_CFTypeGetClass ( allocator ) != __CFISAForCFAllocator ()) { // malloc_zone_t *
600
600
return malloc_zone_malloc ((malloc_zone_t * )allocator , size );
601
601
}
602
602
#endif
@@ -619,15 +619,15 @@ void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize
619
619
}
620
620
621
621
#if defined(DEBUG ) && TARGET_OS_MAC
622
- if (allocator -> _base . _cfisa == __CFISAForCFAllocator ()) {
622
+ if (_CFTypeGetClass ( allocator ) == __CFISAForCFAllocator ()) {
623
623
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
624
624
}
625
625
#else
626
626
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
627
627
#endif
628
628
if (NULL == ptr && 0 < newsize ) {
629
629
#if TARGET_OS_MAC
630
- if (allocator -> _base . _cfisa != __CFISAForCFAllocator ()) { // malloc_zone_t *
630
+ if (_CFTypeGetClass ( allocator ) != __CFISAForCFAllocator ()) { // malloc_zone_t *
631
631
return malloc_zone_malloc ((malloc_zone_t * )allocator , newsize );
632
632
}
633
633
#endif
@@ -640,7 +640,7 @@ void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize
640
640
}
641
641
if (NULL != ptr && 0 == newsize ) {
642
642
#if TARGET_OS_MAC
643
- if (allocator -> _base . _cfisa != __CFISAForCFAllocator ()) { // malloc_zone_t *
643
+ if (_CFTypeGetClass ( allocator ) != __CFISAForCFAllocator ()) { // malloc_zone_t *
644
644
#if defined(DEBUG )
645
645
size_t size = malloc_size (ptr );
646
646
if (size ) memset (ptr , 0xCC , size );
@@ -657,7 +657,7 @@ void *CFAllocatorReallocate(CFAllocatorRef allocator, void *ptr, CFIndex newsize
657
657
}
658
658
if (NULL == ptr && 0 == newsize ) return NULL ;
659
659
#if TARGET_OS_MAC
660
- if (allocator -> _base . _cfisa != __CFISAForCFAllocator ()) { // malloc_zone_t *
660
+ if (_CFTypeGetClass ( allocator ) != __CFISAForCFAllocator ()) { // malloc_zone_t *
661
661
return malloc_zone_realloc ((malloc_zone_t * )allocator , ptr , newsize );
662
662
}
663
663
#endif
@@ -675,14 +675,14 @@ void CFAllocatorDeallocate(CFAllocatorRef allocator, void *ptr) {
675
675
}
676
676
677
677
#if defined(DEBUG ) && TARGET_OS_MAC
678
- if (allocator -> _base . _cfisa == __CFISAForCFAllocator ()) {
678
+ if (_CFTypeGetClass ( allocator ) == __CFISAForCFAllocator ()) {
679
679
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
680
680
}
681
681
#else
682
682
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
683
683
#endif
684
684
#if TARGET_OS_MAC
685
- if (allocator -> _base . _cfisa != __CFISAForCFAllocator ()) { // malloc_zone_t *
685
+ if (_CFTypeGetClass ( allocator ) != __CFISAForCFAllocator ()) { // malloc_zone_t *
686
686
#if defined(DEBUG )
687
687
size_t size = malloc_size (ptr );
688
688
if (size ) memset (ptr , 0xCC , size );
@@ -704,15 +704,15 @@ CFIndex CFAllocatorGetPreferredSizeForSize(CFAllocatorRef allocator, CFIndex siz
704
704
allocator = __CFGetDefaultAllocator ();
705
705
}
706
706
707
- #if defined( DEBUG ) && TARGET_OS_MAC
708
- if (allocator -> _base . _cfisa == __CFISAForCFAllocator ()) {
707
+ #if TARGET_OS_MAC
708
+ if (_CFTypeGetClass ( allocator ) == __CFISAForCFAllocator ()) {
709
709
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
710
710
}
711
711
#else
712
712
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
713
713
#endif
714
714
#if TARGET_OS_MAC
715
- if (allocator -> _base . _cfisa != __CFISAForCFAllocator ()) { // malloc_zone_t *
715
+ if (_CFTypeGetClass ( allocator ) != __CFISAForCFAllocator ()) { // malloc_zone_t *
716
716
return malloc_good_size (size );
717
717
}
718
718
#endif
@@ -729,16 +729,16 @@ void CFAllocatorGetContext(CFAllocatorRef allocator, CFAllocatorContext *context
729
729
allocator = __CFGetDefaultAllocator ();
730
730
}
731
731
732
- #if defined( DEBUG ) && TARGET_OS_MAC
733
- if (allocator -> _base . _cfisa == __CFISAForCFAllocator ()) {
732
+ #if TARGET_OS_MAC
733
+ if (_CFTypeGetClass ( allocator ) == __CFISAForCFAllocator ()) {
734
734
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
735
735
}
736
736
#else
737
737
__CFGenericValidateType (allocator , _kCFRuntimeIDCFAllocator );
738
738
#endif
739
739
CFAssert1 (0 == context -> version , __kCFLogAssertion , "%s(): context version not initialized to 0" , __PRETTY_FUNCTION__ );
740
740
#if TARGET_OS_MAC
741
- if (allocator -> _base . _cfisa != __CFISAForCFAllocator ()) { // malloc_zone_t *
741
+ if (_CFTypeGetClass ( allocator ) != __CFISAForCFAllocator ()) { // malloc_zone_t *
742
742
return ;
743
743
}
744
744
#endif
@@ -808,7 +808,7 @@ struct __CFNull {
808
808
809
809
DECLARE_STATIC_CLASS_REF (NSNull );
810
810
811
- static struct __CFNull _CF_CONSTANT_OBJECT_BACKING __kCFNull = {
811
+ struct __CFNull _CF_CONSTANT_OBJECT_BACKING __kCFNull = {
812
812
INIT_CFRUNTIME_BASE_WITH_CLASS (NSNull , _kCFRuntimeIDCFNull )
813
813
};
814
814
const CFNullRef kCFNull = & __kCFNull ;
@@ -853,7 +853,8 @@ void _CFRuntimeSetCFMPresent(void *addr) {
853
853
/* Keep this assembly at the bottom of the source file! */
854
854
855
855
856
- extern void __HALT () {
856
+ extern void __HALT (void );
857
+ void __HALT () {
857
858
__builtin_trap ();
858
859
}
859
860
0 commit comments