mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
* Headers/Foundation/NSMethodSignature.h
(_internalMethodTypes): New instance variable. * Source/NSMethodSignature.m: ([+signatureWithObjCTypes]): Store the runtime signature separately from the mframe signature. Document. ([-dealloc]): Free new instance variable. ([-methodInfo]): Use _internalMethodTypes to build argument information. * Source/GSFFCallInvocation.m (GSInvocationCallback) * Source/GSFFIInvocation.m (GSInvocationCallback): Use the selector registered in the runtime for the receiver instead of the constructed selector from the stack to avoid mismatches in the runtime. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19662 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a843b058ca
commit
dbe1800bbd
5 changed files with 74 additions and 5 deletions
|
@ -28,7 +28,8 @@
|
|||
|
||||
#include "config.h"
|
||||
#include "GNUstepBase/preface.h"
|
||||
#include <mframe.h>
|
||||
#include "mframe.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "Foundation/NSMethodSignature.h"
|
||||
#include "Foundation/NSException.h"
|
||||
|
@ -37,6 +38,15 @@
|
|||
|
||||
@implementation NSMethodSignature
|
||||
|
||||
/**
|
||||
* Returns a method signature with the corresponding ObjC types. This
|
||||
* type string must correspond to a type string recognized by the
|
||||
* runtime which is a platform independent representation. Internally
|
||||
* this is transformed to a platform specific representation used
|
||||
* to generate the NSArgumentInfo structures. You should never need
|
||||
* to access this internal representation and it should not be passed
|
||||
* to this method.
|
||||
*/
|
||||
+ (NSMethodSignature*) signatureWithObjCTypes: (const char*)t
|
||||
{
|
||||
NSMethodSignature *newMs;
|
||||
|
@ -46,8 +56,10 @@
|
|||
return nil;
|
||||
}
|
||||
newMs = AUTORELEASE([NSMethodSignature alloc]);
|
||||
newMs->_methodTypes = mframe_build_signature(t, &newMs->_argFrameLength,
|
||||
&newMs->_numArgs, 0);
|
||||
newMs->_methodTypes = NSZoneMalloc(NSDefaultMallocZone(), strlen(t) + 1);
|
||||
strcpy ((char *)newMs->_methodTypes, t);
|
||||
newMs->_internalMethodTypes
|
||||
= mframe_build_signature(t, &newMs->_argFrameLength, &newMs->_numArgs, 0);
|
||||
|
||||
return newMs;
|
||||
}
|
||||
|
@ -121,6 +133,8 @@
|
|||
{
|
||||
if (_methodTypes)
|
||||
NSZoneFree(NSDefaultMallocZone(), (void*)_methodTypes);
|
||||
if (_internalMethodTypes)
|
||||
NSZoneFree(NSDefaultMallocZone(), (void*)_internalMethodTypes);
|
||||
if (_info)
|
||||
NSZoneFree(NSDefaultMallocZone(), (void*)_info);
|
||||
[super dealloc];
|
||||
|
@ -168,7 +182,7 @@
|
|||
{
|
||||
if (_info == 0)
|
||||
{
|
||||
const char *types = _methodTypes;
|
||||
const char *types = _internalMethodTypes;
|
||||
unsigned int i;
|
||||
|
||||
_info = NSZoneMalloc(NSDefaultMallocZone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue