mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Rewrite of invocation code with new mframe code.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2930 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
517bb29e48
commit
be3ff6a3e3
5 changed files with 1150 additions and 872 deletions
|
@ -60,6 +60,21 @@
|
|||
* Define a structure to hold information that is held locally
|
||||
* (before the start) in each object.
|
||||
*/
|
||||
|
||||
typedef struct obj_layout_unpadded {
|
||||
#if defined(REFCNT_LOCAL)
|
||||
unsigned retained;
|
||||
#endif
|
||||
#if defined(CACHE_ZONE)
|
||||
NSZone *zone;
|
||||
#endif
|
||||
} unp;
|
||||
|
||||
/*
|
||||
* Now do the REAL version - using the other version to determine
|
||||
* what padding (if any) is required to get the alignment of the
|
||||
* structure correct.
|
||||
*/
|
||||
struct obj_layout {
|
||||
#if defined(REFCNT_LOCAL)
|
||||
unsigned retained;
|
||||
|
@ -67,6 +82,7 @@ struct obj_layout {
|
|||
#if defined(CACHE_ZONE)
|
||||
NSZone *zone;
|
||||
#endif
|
||||
char padding[__alignof(double) - sizeof(unp)%__alignof__(double)];
|
||||
};
|
||||
typedef struct obj_layout *obj;
|
||||
|
||||
|
@ -439,24 +455,12 @@ static BOOL double_release_check_enabled = NO;
|
|||
|
||||
- (retval_t) forward:(SEL)aSel :(arglist_t)argFrame
|
||||
{
|
||||
void *retFrame;
|
||||
NSMethodSignature *sig;
|
||||
NSInvocation *inv;
|
||||
int retLength;
|
||||
|
||||
inv = [[[NSInvocation alloc] initWithArgframe: argFrame
|
||||
selector: aSel] autorelease];
|
||||
/* is this right? */
|
||||
sig = [inv methodSignature];
|
||||
retLength = [sig methodReturnLength];
|
||||
/* Make sure we have something even if we are returnign void */
|
||||
if (retLength == 0)
|
||||
retLength = sizeof(void*);
|
||||
|
||||
retFrame = (void*) alloca(retLength);
|
||||
[self forwardInvocation:inv];
|
||||
[inv getReturnValue: retFrame];
|
||||
return retFrame;
|
||||
return [inv returnFrame: argFrame];
|
||||
}
|
||||
|
||||
- (void) forwardInvocation: (NSInvocation*)anInvocation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue