25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
* need to use the implementation from Foundation to make ObjFWBridge work. We
* can't use the ObjFWRT implementation as that would result in two parallel
* autorelease pool chains.
*/
#include "config.h"
#import <Foundation/Foundation.h>
void *
objc_autoreleasePoolPush(void)
{
return [[NSAutoreleasePool alloc] init];
}
void
objc_autoreleasePoolPop(void *pool)
{
return [(id)pool drain];
}
id
_objc_rootAutorelease(id object)
{
[NSAutoreleasePool addObject: object];
return object;
}
|
|
>
>
|
|
|
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
* need to use the implementation from Foundation to make ObjFWBridge work. We
* can't use the ObjFWRT implementation as that would result in two parallel
* autorelease pool chains.
*/
#include "config.h"
extern void *NSPushAutoreleasePool(unsigned int count);
extern void NSPopAutoreleasePool(void *pool);
extern void NSAutoreleaseObject(id object);
void *
objc_autoreleasePoolPush(void)
{
return NSPushAutoreleasePool(0);
}
void
objc_autoreleasePoolPop(void *pool)
{
NSPopAutoreleasePool(pool);
}
id
_objc_rootAutorelease(id object)
{
NSAutoreleaseObject(object);
return object;
}
|