mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
avoid unnecessary requests for signatures to remote process
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29652 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c815ae549b
commit
7e8e79ae94
3 changed files with 32 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2010-02-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSDistantObject.m:
|
||||||
|
Cache method signatures to avoid asking remote end for them
|
||||||
|
repeatedly.
|
||||||
|
|
||||||
2010-02-16 Wolfgang Lux <wolfgang.lux@gmail.com>
|
2010-02-16 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* Source/Additions/Unicode.m (GSToUnicode): Fix bug where
|
* Source/Additions/Unicode.m (GSToUnicode): Fix bug where
|
||||||
|
|
|
@ -44,7 +44,7 @@ extern "C" {
|
||||||
unsigned _handle;
|
unsigned _handle;
|
||||||
Protocol *_protocol;
|
Protocol *_protocol;
|
||||||
unsigned _counter;
|
unsigned _counter;
|
||||||
void *_unused;
|
void *_sigs;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#import "GNUstepBase/DistributedObjects.h"
|
#import "GNUstepBase/DistributedObjects.h"
|
||||||
#import "GNUstepBase/GSObjCRuntime.h"
|
#import "GNUstepBase/GSObjCRuntime.h"
|
||||||
#import "Foundation/NSDebug.h"
|
#import "Foundation/NSDebug.h"
|
||||||
|
#import "Foundation/NSDictionary.h"
|
||||||
#import "Foundation/NSLock.h"
|
#import "Foundation/NSLock.h"
|
||||||
#import "Foundation/NSPort.h"
|
#import "Foundation/NSPort.h"
|
||||||
#import "Foundation/NSMethodSignature.h"
|
#import "Foundation/NSMethodSignature.h"
|
||||||
|
@ -467,6 +468,7 @@ enum proxyLocation
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
[self finalize];
|
[self finalize];
|
||||||
|
if (_sigs != 0) [(NSMutableDictionary*)_sigs release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,7 +634,7 @@ enum proxyLocation
|
||||||
|
|
||||||
if (debug_proxy)
|
if (debug_proxy)
|
||||||
NSLog(@"Created new local=0x%x object 0x%x target 0x%x connection 0x%x\n",
|
NSLog(@"Created new local=0x%x object 0x%x target 0x%x connection 0x%x\n",
|
||||||
(uintptr_t)self, (uintptr_t)_object, _handle, (uintptr_t)_connection);
|
(uintptr_t)self, (uintptr_t)_object, _handle, (uintptr_t)_connection);
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -752,6 +754,15 @@ enum proxyLocation
|
||||||
return [NSMethodSignature signatureWithObjCTypes: types];
|
return [NSMethodSignature signatureWithObjCTypes: types];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_sigs != 0)
|
||||||
|
{
|
||||||
|
NSMutableDictionary *d = (NSMutableDictionary*)_sigs;
|
||||||
|
NSString *s = NSStringFromSelector(aSelector);
|
||||||
|
NSMethodSignature *m = [d objectForKey: s];
|
||||||
|
|
||||||
|
if (m != nil) return m;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
id m = nil;
|
id m = nil;
|
||||||
id inv;
|
id inv;
|
||||||
|
@ -763,11 +774,23 @@ enum proxyLocation
|
||||||
{
|
{
|
||||||
const char *types;
|
const char *types;
|
||||||
|
|
||||||
types = [m methodType];
|
types = [m methodType];
|
||||||
/* Create a local method signature.
|
/* Create a local method signature.
|
||||||
*/
|
*/
|
||||||
m = [NSMethodSignature signatureWithObjCTypes: types];
|
m = [NSMethodSignature signatureWithObjCTypes: types];
|
||||||
}
|
}
|
||||||
|
if (m != nil)
|
||||||
|
{
|
||||||
|
NSMutableDictionary *d = (NSMutableDictionary*)_sigs;
|
||||||
|
NSString *s = NSStringFromSelector(aSelector);
|
||||||
|
|
||||||
|
if (d == nil)
|
||||||
|
{
|
||||||
|
d = [NSMutableDictionary new];
|
||||||
|
_sigs = (void*)d;
|
||||||
|
}
|
||||||
|
[d setObject: m forKey: s];
|
||||||
|
}
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue