ObjFW  Check-in [348b389736]

Overview
Comment:Actually, it makes sense that - release returns self.
This way, you can check if the object has been free'd, for example
using if ((obj = [obj release]) == nil).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 348b389736026cf764a0d57f09d2179c5751f11e493850d8e362051739e76c8e
User & Date: js on 2009-04-19 20:19:54
Other Links: manifest | tags
Context
2009-04-19
20:22
Remove useless definitions. check-in: a756d3f511 user: js tags: trunk
20:19
Actually, it makes sense that - release returns self.
This way, you can check if the object has been free'd, for example
using if ((obj = [obj release]) == nil).
check-in: 348b389736 user: js tags: trunk
18:38
Small documentation fix. check-in: 630a522f46 user: js tags: trunk
Changes

Modified src/OFConstString.m from [979d9dc589] to [34a543db8a].

77
78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
93
94
95
96
97
}

- retain
{
	return self;
}

- (void)release
{

}

- (size_t)retainCount
{
	return 1;
}

- autorelease
{
	return self;
}
@end







|

>












77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
}

- retain
{
	return self;
}

- release
{
	return self;
}

- (size_t)retainCount
{
	return 1;
}

- autorelease
{
	return self;
}
@end

Modified src/OFObject.h from [9fc0378e5d] to [84bfaf3d9b].

194
195
196
197
198
199
200
201
202
203
204
205
206
207
 * \return The retain count
 */
- (size_t)retainCount;

/**
 * Decreases the retain cound and frees the object if it reaches 0.
 */
- (void)release;

/**
 * Frees the object and also frees all memory allocated via its memory pool.
 */
- free;
@end







|






194
195
196
197
198
199
200
201
202
203
204
205
206
207
 * \return The retain count
 */
- (size_t)retainCount;

/**
 * Decreases the retain cound and frees the object if it reaches 0.
 */
- release;

/**
 * Frees the object and also frees all memory allocated via its memory pool.
 */
- free;
@end

Modified src/OFObject.m from [a0cbb15bb4] to [deb9ba26f1].

381
382
383
384
385
386
387
388
389
390
391


392
393
394
395
396
397
398
}

- (size_t)retainCount
{
	return PRE_IVAR->retain_count;
}

- (void)release
{
	if (!--PRE_IVAR->retain_count)
		[self free];


}

- free
{
	void **iter = PRE_IVAR->memchunks + PRE_IVAR->memchunks_size;

	while (iter-- > PRE_IVAR->memchunks)







|


|
>
>







381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
}

- (size_t)retainCount
{
	return PRE_IVAR->retain_count;
}

- release
{
	if (!--PRE_IVAR->retain_count)
		return [self free];

	return self;
}

- free
{
	void **iter = PRE_IVAR->memchunks + PRE_IVAR->memchunks_size;

	while (iter-- > PRE_IVAR->memchunks)