Use get_imp() to get method implementation

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26359 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-03-19 08:57:14 +00:00
parent c895d41e78
commit 4fb2f3c708
2 changed files with 14 additions and 24 deletions

View file

@ -1,3 +1,8 @@
2008-03-19 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSAutoreleasePool.m: Use get_imp() to fetch the
implementation of the release method.
2008-03-19 Richard Frith-Macdonald <rfm@gnu.org> 2008-03-19 Richard Frith-Macdonald <rfm@gnu.org>
* Source/DocMakefile: include GNUstep.h * Source/DocMakefile: include GNUstep.h

View file

@ -406,31 +406,16 @@ static IMP initImp;
hash = (((unsigned)(uintptr_t)c) >> 3) & 0x0f; hash = (((unsigned)(uintptr_t)c) >> 3) & 0x0f;
if (classes[hash] != c) if (classes[hash] != c)
{ {
IMP imp; /* If anObject was an instance, c is it's class.
* If anObject was a class, c is its metaclass.
#if 1 * Either way, get_imp() should get the appropriate pointer.
if (GSObjCIsInstance(anObject)) * If anObject is a proxy to something,
{ * the +instanceMethodForSelector: and -methodForSelector:
/* We call instanceMethodForSelector: on the class * methods may not exist, but get_imp() will return the
* rather than methodForSelector: because EOFault * address of the forwarding method if necessary.
* implements the former but not the latter. */
*/ imps[hash] = get_imp(c, @selector(release));
imp = [c instanceMethodForSelector: releaseSel];
}
else
{
imp = [c methodForSelector: releaseSel];
}
if (imp == 0)
{
[NSException raise: NSInternalInconsistencyException
format: @"nul release for object in autorelease pool"];
}
#else
imp = get_imp(anObject, @selector(release));
#endif
classes[hash] = c; classes[hash] = c;
imps[hash] = imp;
} }
(imps[hash])(anObject, releaseSel); (imps[hash])(anObject, releaseSel);
} }