mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 17:51:01 +00:00
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:
parent
c895d41e78
commit
4fb2f3c708
2 changed files with 14 additions and 24 deletions
|
@ -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
|
||||||
|
|
|
@ -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.
|
|
||||||
*/
|
*/
|
||||||
imp = [c instanceMethodForSelector: releaseSel];
|
imps[hash] = get_imp(c, @selector(release));
|
||||||
}
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue