Set some ivars (delegates which should not be retained) to be gc invisible.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27591 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-01-13 20:52:49 +00:00
parent 0913c7cb95
commit ba4e623f5e
8 changed files with 28 additions and 3 deletions

View file

@ -143,6 +143,11 @@ static RunLoopEventType typeForStream(NSStream *aStream)
@implementation GSStream @implementation GSStream
+ (void) initialize
{
class_ivar_set_gcinvisible (self, "delegate", YES);
}
- (void) close - (void) close
{ {
if (_currentStatus == NSStreamStatusNotOpen) if (_currentStatus == NSStreamStatusNotOpen)
@ -626,6 +631,7 @@ static RunLoopEventType typeForStream(NSStream *aStream)
if (self == [GSInputStream class]) if (self == [GSInputStream class])
{ {
GSObjCAddClassBehavior(self, [GSStream class]); GSObjCAddClassBehavior(self, [GSStream class]);
class_ivar_set_gcinvisible (self, "delegate", YES);
} }
} }
@ -658,6 +664,7 @@ static RunLoopEventType typeForStream(NSStream *aStream)
if (self == [GSOutputStream class]) if (self == [GSOutputStream class])
{ {
GSObjCAddClassBehavior(self, [GSStream class]); GSObjCAddClassBehavior(self, [GSStream class]);
class_ivar_set_gcinvisible (self, "delegate", YES);
} }
} }
@ -929,6 +936,11 @@ static RunLoopEventType typeForStream(NSStream *aStream)
@implementation GSServerStream @implementation GSServerStream
+ (void) initialize
{
class_ivar_set_gcinvisible (self, "delegate", YES);
}
+ (id) serverStreamToAddr: (NSString*)addr port: (int)port + (id) serverStreamToAddr: (NSString*)addr port: (int)port
{ {
GSServerStream *s; GSServerStream *s;

View file

@ -545,6 +545,7 @@ static NSLock *cached_proxies_gate = nil;
{ {
NSNotificationCenter *nc; NSNotificationCenter *nc;
class_ivar_set_gcinvisible (self, "delegate", YES);
connectionClass = self; connectionClass = self;
dateClass = [NSDate class]; dateClass = [NSDate class];
distantObjectClass = [NSDistantObject class]; distantObjectClass = [NSDistantObject class];

View file

@ -464,6 +464,8 @@ static NSDictionary *makeReference(unsigned ref)
+ (void) initialize + (void) initialize
{ {
class_ivar_set_gcinvisible (self, "delegate", YES);
if (globalClassMap == 0) if (globalClassMap == 0)
{ {
globalClassMap = globalClassMap =

View file

@ -274,6 +274,8 @@ static NSMapTable globalClassMap = 0;
+ (void) initialize + (void) initialize
{ {
class_ivar_set_gcinvisible (self, "delegate", YES);
if (globalClassMap == 0) if (globalClassMap == 0)
{ {
globalClassMap = globalClassMap =

View file

@ -81,6 +81,8 @@ static Class NSPort_concrete_class;
{ {
NSUserDefaults *defs; NSUserDefaults *defs;
class_ivar_set_gcinvisible (self, "delegate", YES);
NSPort_abstract_class = self; NSPort_abstract_class = self;
NSPort_concrete_class = [NSMessagePort class]; NSPort_concrete_class = [NSMessagePort class];

View file

@ -66,6 +66,12 @@ static NSNull *null = nil;
@implementation NSXMLSAXHandler @implementation NSXMLSAXHandler
+ (void) initialize
{
class_ivar_set_gcinvisible (self, "_delegate", YES);
class_ivar_set_gcinvisible (self, "_owner", YES);
}
- (void) dealloc - (void) dealloc
{ {
DESTROY(_namespaces); DESTROY(_namespaces);

4
configure vendored
View file

@ -3673,8 +3673,8 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
else else
{ echo "$as_me:$LINENO: It looks like your libgc is quite old ... please use a newer one to support making the garbage collector aware of new threads." >&5 { echo "$as_me:$LINENO: It looks like your libgc is quite old ... please consider using a newer one to support making the garbage collector aware of new threads. You can get libgc source from http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc-source/ but NB. the libgc used must be compatible with the version of the objective-c runtime library that you are using." >&5
echo "$as_me: It looks like your libgc is quite old ... please use a newer one to support making the garbage collector aware of new threads." >&6;} echo "$as_me: It looks like your libgc is quite old ... please consider using a newer one to support making the garbage collector aware of new threads. You can get libgc source from http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc-source/ but NB. the libgc used must be compatible with the version of the objective-c runtime library that you are using." >&6;}
fi fi
LIBS="-lobjc_gc -ldl" LIBS="-lobjc_gc -ldl"
echo "$as_me:$LINENO: checking for class_ivar_set_gcinvisible" >&5 echo "$as_me:$LINENO: checking for class_ivar_set_gcinvisible" >&5

View file

@ -277,7 +277,7 @@ if test $OBJC_WITH_GC = yes; then
AC_DEFINE(HAVE_GC_REGISTER_MY_THREAD,1, AC_DEFINE(HAVE_GC_REGISTER_MY_THREAD,1,
[Define if GC_register_my_thread function is available]) [Define if GC_register_my_thread function is available])
else else
AC_MSG_NOTICE([It looks like your libgc is quite old ... please use a newer one to support making the garbage collector aware of new threads.]) AC_MSG_NOTICE([It looks like your libgc is quite old ... please consider using a newer one to support making the garbage collector aware of new threads. You can get libgc source from http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc-source/ but NB. the libgc used must be compatible with the version of the objective-c runtime library that you are using.])
fi fi
LIBS="-lobjc_gc -ldl" LIBS="-lobjc_gc -ldl"
AC_CHECK_FUNC(class_ivar_set_gcinvisible, gc_ok=yes, gc_ok=no) AC_CHECK_FUNC(class_ivar_set_gcinvisible, gc_ok=yes, gc_ok=no)