diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2008-07-31 14:43:35 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2008-07-31 14:43:35 (GMT) |
commit | 53bc9e6c6a1e6f0cfa6ad54e6c95be54753e3b49 (patch) | |
tree | 6c96fbd692f683a13fbe376d5e0fb3f7aec3a3b5 /generic/tclInt.h | |
parent | 8b4bd2bb9a913d76dbb65ca98921a537bce251fd (diff) | |
download | tcl-53bc9e6c6a1e6f0cfa6ad54e6c95be54753e3b49.zip tcl-53bc9e6c6a1e6f0cfa6ad54e6c95be54753e3b49.tar.gz tcl-53bc9e6c6a1e6f0cfa6ad54e6c95be54753e3b49.tar.bz2 |
Dumped tclNRE.h's contents into tclInt.h. The file is now empty and
unrefernced everywhere but in macosx/Tcl.xcodeproj/project.pbxproj: some
knowledgeable maintainer please remove tclNRE.h after making sure it
doesn't break the build on macosx
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index fb77ec5..a098b5f 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -10,11 +10,12 @@ * Copyright (c) 2001, 2002 by Kevin B. Kenny. All rights reserved. * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net> * Copyright (c) 2006-2008 by Joe Mistachkin. All rights reserved. + * Copyright (c) 2008 by Miguel Sofer. All rights reserved. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.381 2008/07/29 18:19:12 msofer Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.382 2008/07/31 14:43:45 msofer Exp $ */ #ifndef _TCLINT @@ -2527,6 +2528,8 @@ MODULE_SCOPE char tclEmptyString; MODULE_SCOPE Tcl_ObjCmdProc TclNRNamespaceObjCmd; MODULE_SCOPE Tcl_ObjCmdProc TclNRApplyObjCmd; MODULE_SCOPE Tcl_ObjCmdProc TclNRUplevelObjCmd; +MODULE_SCOPE Tcl_ObjCmdProc TclTailcallObjCmd; + MODULE_SCOPE int TclNREvalCmd(Tcl_Interp * interp, Tcl_Obj * objPtr, int flags); @@ -4006,6 +4009,7 @@ MODULE_SCOPE void TclBNInitBignumFromWideUInt(mp_int *bignum, * size is dynamic, a panic will be compiled in for the wrong case. * * DO NOT LET THEM CROSS THREAD BOUNDARIES + *---------------------------------------------------------------- */ #define TclSmallAlloc(nbytes, memPtr) \ @@ -4059,6 +4063,67 @@ MODULE_SCOPE void TclBNInitBignumFromWideUInt(mp_int *bignum, } #endif /* TCL_MEM_DEBUG */ +/* + *---------------------------------------------------------------- + * Parameters, structs and macros for the non-recursive engine (NRE) + *---------------------------------------------------------------- + */ + +#define NRE_USE_SMALL_ALLOC 1 /* Only turn off for debugging purposes. */ +#define NRE_ENABLE_ASSERTS 1 + +/* + * This is the main data struct for representing NR commands. It is designed + * to fit in sizeof(Tcl_Obj) in order to exploit the fastest memory allocator + * available. + */ + +typedef struct TEOV_callback { + Tcl_NRPostProc *procPtr; + ClientData data[4]; + struct TEOV_callback *nextPtr; +} TEOV_callback; + +#define TOP_CB(iPtr) (((Interp *)(iPtr))->execEnvPtr->callbackPtr) + +/* + * Inline version of Tcl_NRAddCallback + */ + +#define TclNRAddCallback( \ + interp, \ + postProcPtr, \ + data0, \ + data1, \ + data2, \ + data3) \ + { \ + TEOV_callback *callbackPtr; \ + TCLNR_ALLOC((interp), (callbackPtr)); \ + callbackPtr->procPtr = (postProcPtr); \ + callbackPtr->data[0] = (data0); \ + callbackPtr->data[1] = (data1); \ + callbackPtr->data[2] = (data2); \ + callbackPtr->data[3] = (data3); \ + callbackPtr->nextPtr = TOP_CB(interp); \ + TOP_CB(interp) = callbackPtr; \ + } + +#if NRE_USE_SMALL_ALLOC +#define TCLNR_ALLOC(interp, ptr) TclSmallAllocEx(interp, sizeof(TEOV_callback), (ptr)) +#define TCLNR_FREE(interp, ptr) TclSmallFreeEx((interp), (ptr)) +#else +#define TCLNR_ALLOC(interp, ptr) (ptr = ((ClientData) ckalloc(sizeof(TEOV_callback)))) +#define TCLNR_FREE(interp, ptr) ckfree((char *) (ptr)) +#endif + +#if NRE_ENABLE_ASSERTS +#define NRE_ASSERT(expr) assert((expr)) +#else +#define NRE_ASSERT(expr) +#endif + + #include "tclPort.h" #include "tclIntDecls.h" |