(objc_set_autorelease_class): New function.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1994-11-08 18:11:07 +00:00
parent 883031612e
commit e2c3df41f8

View file

@ -33,6 +33,9 @@
/* The hashtable of retain counts on objects */
static coll_cache_ptr retain_counts = NULL;
/* The Class responsible for handling autorelease's */
static id autorelease_class = nil;
static void
init_retain_counts_if_necessary()
{
@ -91,6 +94,11 @@ objc_retain_count (id anObj)
return 0;
}
void
objc_set_autorelease_class (id the_autorelease_class)
{
auto_release_class = the_autorelease_class;
}
@implementation Object (RetainingObject)
@ -115,4 +123,10 @@ objc_retain_count (id anObj)
return objc_retain_count(self);
}
- autorelease
{
[the_autorelease_class addObject:self];
returnself;
}
@end