Make object allocation and deallocation use the runtime.

All objects are now created and destroyed by the runtime, so we have
clean layering between -base and libobjc.
This commit is contained in:
David Chisnall 2017-12-13 18:22:08 +00:00
parent c3921ee1f7
commit e35eb61dbc
2 changed files with 40 additions and 0 deletions

View file

@ -1,6 +1,9 @@
#import "ObjectTesting.h"
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSProxy.h>
#if __has_include(<objc/capabilities.h>
#include <objc/capabilities.h>
#endif
int main()
{
@ -24,8 +27,10 @@ int main()
obj1 = [NSProxy allocWithZone:testZone];
PASS(obj1 != nil, "%s has working allocWithZone:",prefix);
#ifndef OBJC_CAP_ARC
PASS(NSZoneFromPointer(obj1) == testZone, "%s uses zone for alloc",prefix);
PASS([obj1 zone] == testZone, "%s -zone works",prefix);
#endif
PASS([obj1 hash] != 0, "%s has working -hash",prefix);
PASS([obj1 isEqual:obj1] == YES, "%s has working -isEqual:",prefix);