ObjFW  Diff

Differences From Artifact [b23ad42b20]:

To Artifact [d4653e60d0]:


1
2
3
4
5
6
7
8
9
10
11
12


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2008 - 2009
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of libobjfw. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"



/**
 * The OFAutoreleasePool class provides a class that keeps track of objects
 * that will be released when the autorelease pool is released.
 * Every thread has its own stack of autorelease pools.
 */
@interface OFAutoreleasePool: OFObject
{
	OFObject **objects;
	size_t	 size;
}

/**
 * Adds an object to the autorelease pool at the top of the thread-specific
 * stack.
 *
 * \param obj The object to add to the autorelease pool












>
>








|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Copyright (c) 2008 - 2009
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of libobjfw. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE included in
 * the packaging of this file.
 */

#import "OFObject.h"
#import "OFArray.h"
#import "OFList.h"

/**
 * The OFAutoreleasePool class provides a class that keeps track of objects
 * that will be released when the autorelease pool is released.
 * Every thread has its own stack of autorelease pools.
 */
@interface OFAutoreleasePool: OFObject
{
	OFArray		 *objects;
	of_list_object_t *listobj;
}

/**
 * Adds an object to the autorelease pool at the top of the thread-specific
 * stack.
 *
 * \param obj The object to add to the autorelease pool
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 * \param obj The object to add to the autorelease pool
 */
- addToPool: (OFObject*)obj;

/**
 * Releases all objects in the autorelease pool.
 */
- release;

/**
 * \returns All objects in the autorelease pool
 */
- (OFObject**)objects;
@end







|
<
<
<
<
<

39
40
41
42
43
44
45
46





47
 * \param obj The object to add to the autorelease pool
 */
- addToPool: (OFObject*)obj;

/**
 * Releases all objects in the autorelease pool.
 */
- releaseObjects;





@end