Preliminary code for emulation of the objc2 runtime weak reference feature

This commit is contained in:
rfm 2024-12-23 18:32:23 +00:00
parent 950e2a5f07
commit c66bd6ec5c
11 changed files with 472 additions and 81 deletions

View file

@ -1,21 +1,10 @@
#import "ObjectTesting.h"
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSPointerArray.h>
#if __has_include(<objc/capabilities.h>)
#include <objc/capabilities.h>
#endif
int main()
{
START_SET("NSPointerArray weak objects")
#if !__APPLE__ // We assume that apple systems support zeroing weak pointers
#ifdef OBJC_CAP_ARC
if (!objc_test_capability(OBJC_CAP_ARC))
#endif
{
SKIP("ARC support unavailable")
}
#endif
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSPointerArray *array = [NSPointerArray weakObjectsPointerArray];
int index;