diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2008-07-29 05:30:25 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2008-07-29 05:30:25 (GMT) |
commit | 2eec1c8e78758156521c033507b1a4513e80d1be (patch) | |
tree | 4c1271ec62dc5e1d48fc5559a5b9e8320ba3522a /generic/tclOOMethod.c | |
parent | f0e9c26da804fcb46360eebe2164bf251f89f4e3 (diff) | |
download | tcl-2eec1c8e78758156521c033507b1a4513e80d1be.zip tcl-2eec1c8e78758156521c033507b1a4513e80d1be.tar.gz tcl-2eec1c8e78758156521c033507b1a4513e80d1be.tar.bz2 |
Completely revamped NRE implementation, with (almost) unchanged API.
Diffstat (limited to 'generic/tclOOMethod.c')
-rw-r--r-- | generic/tclOOMethod.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 8ce3c34..9cd2678 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclOOMethod.c,v 1.10 2008/07/27 22:28:54 dkf Exp $ + * RCS: @(#) $Id: tclOOMethod.c,v 1.11 2008/07/29 05:30:37 msofer Exp $ */ #ifdef HAVE_CONFIG_H @@ -55,6 +55,8 @@ static Tcl_Obj ** InitEnsembleRewrite(Tcl_Interp *interp, int objc, static int InvokeProcedureMethod(ClientData clientData, Tcl_Interp *interp, Tcl_ObjectContext context, int objc, Tcl_Obj *const *objv); +static int FinalizeForwardCall(ClientData data[], Tcl_Interp *interp, + int result); static int FinalizePMCall(ClientData data[], Tcl_Interp *interp, int result); static int PushMethodCallFrame(Tcl_Interp *interp, @@ -1131,7 +1133,7 @@ InvokeForwardMethod( CallContext *contextPtr = (CallContext *) context; ForwardMethod *fmPtr = clientData; Tcl_Obj **argObjs, **prefixObjs; - int numPrefixes, result, len, skip = contextPtr->skip; + int numPrefixes, len, skip = contextPtr->skip; /* * Build the real list of arguments to use. Note that we know that the @@ -1144,7 +1146,18 @@ InvokeForwardMethod( argObjs = InitEnsembleRewrite(interp, objc, objv, skip, numPrefixes, prefixObjs, &len); - result = Tcl_NREvalObjv(interp, len, argObjs, TCL_EVAL_INVOKE); + Tcl_NRAddCallback(interp, FinalizeForwardCall, argObjs, NULL, NULL, NULL); + return Tcl_NREvalObjv(interp, len, argObjs, TCL_EVAL_INVOKE); +} + +static int +FinalizeForwardCall( + ClientData data[], + Tcl_Interp *interp, + int result) +{ + Tcl_Obj **argObjs = data[0]; + TclStackFree(interp, argObjs); return result; } |