diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2004-12-15 20:44:17 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2004-12-15 20:44:17 (GMT) |
commit | 96a4475c4aa4e7f173d328e2a6f37770ae35f497 (patch) | |
tree | 03db1466c686ac3541167c4b12439b026a69750f /generic/tclIntDecls.h | |
parent | e3284f29c46d7eb7bdc8b89b1094f1024310bfc7 (diff) | |
download | tcl-96a4475c4aa4e7f173d328e2a6f37770ae35f497.zip tcl-96a4475c4aa4e7f173d328e2a6f37770ae35f497.tar.gz tcl-96a4475c4aa4e7f173d328e2a6f37770ae35f497.tar.bz2 |
* generic/tclTest.c: Added two new functions to allocate memory
from the execution stack (TclStackAlloc, TclStackFree). Added
functions TclPushStackFrame and TclPopStackFrame that do the work
of Tcl_PushCallFrame and Tcl_PopCallFrame, but using frames
allocated in the execution stack - i.e., heap instead of
C-stack. The core uses these two new functions exclusively; the
old ones remain for backwards compat, as at least two popular
extensions (itcl, xotcl) are known to use them.
Diffstat (limited to 'generic/tclIntDecls.h')
-rw-r--r-- | generic/tclIntDecls.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index ed4b443..23acb90 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIntDecls.h,v 1.75 2004/12/01 23:18:52 dgp Exp $ + * RCS: @(#) $Id: tclIntDecls.h,v 1.76 2004/12/15 20:44:39 msofer Exp $ */ #ifndef _TCLINTDECLS @@ -1118,6 +1118,30 @@ EXTERN Tcl_Obj * TclGetObjNameOfExecutable _ANSI_ARGS_((void)); EXTERN void TclSetObjNameOfExecutable _ANSI_ARGS_(( Tcl_Obj * name, Tcl_Encoding encoding)); #endif +#ifndef TclStackAlloc_TCL_DECLARED +#define TclStackAlloc_TCL_DECLARED +/* 215 */ +EXTERN char * TclStackAlloc _ANSI_ARGS_((Tcl_Interp * interp, + int numBytes)); +#endif +#ifndef TclStackFree_TCL_DECLARED +#define TclStackFree_TCL_DECLARED +/* 216 */ +EXTERN void TclStackFree _ANSI_ARGS_((Tcl_Interp * interp)); +#endif +#ifndef TclPushStackFrame_TCL_DECLARED +#define TclPushStackFrame_TCL_DECLARED +/* 217 */ +EXTERN int TclPushStackFrame _ANSI_ARGS_((Tcl_Interp * interp, + Tcl_CallFrame ** framePtrPtr, + Tcl_Namespace * namespacePtr, + int isProcCallFrame)); +#endif +#ifndef TclPopStackFrame_TCL_DECLARED +#define TclPopStackFrame_TCL_DECLARED +/* 218 */ +EXTERN void TclPopStackFrame _ANSI_ARGS_((Tcl_Interp * interp)); +#endif typedef struct TclIntStubs { int magic; @@ -1353,6 +1377,10 @@ typedef struct TclIntStubs { void (*tclpFindExecutable) _ANSI_ARGS_((CONST char * argv0)); /* 212 */ Tcl_Obj * (*tclGetObjNameOfExecutable) _ANSI_ARGS_((void)); /* 213 */ void (*tclSetObjNameOfExecutable) _ANSI_ARGS_((Tcl_Obj * name, Tcl_Encoding encoding)); /* 214 */ + char * (*tclStackAlloc) _ANSI_ARGS_((Tcl_Interp * interp, int numBytes)); /* 215 */ + void (*tclStackFree) _ANSI_ARGS_((Tcl_Interp * interp)); /* 216 */ + int (*tclPushStackFrame) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_CallFrame ** framePtrPtr, Tcl_Namespace * namespacePtr, int isProcCallFrame)); /* 217 */ + void (*tclPopStackFrame) _ANSI_ARGS_((Tcl_Interp * interp)); /* 218 */ } TclIntStubs; #ifdef __cplusplus @@ -2100,6 +2128,22 @@ extern TclIntStubs *tclIntStubsPtr; #define TclSetObjNameOfExecutable \ (tclIntStubsPtr->tclSetObjNameOfExecutable) /* 214 */ #endif +#ifndef TclStackAlloc +#define TclStackAlloc \ + (tclIntStubsPtr->tclStackAlloc) /* 215 */ +#endif +#ifndef TclStackFree +#define TclStackFree \ + (tclIntStubsPtr->tclStackFree) /* 216 */ +#endif +#ifndef TclPushStackFrame +#define TclPushStackFrame \ + (tclIntStubsPtr->tclPushStackFrame) /* 217 */ +#endif +#ifndef TclPopStackFrame +#define TclPopStackFrame \ + (tclIntStubsPtr->tclPopStackFrame) /* 218 */ +#endif #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ |