diff options
author | dgp <dgp@users.sourceforge.net> | 2008-04-08 16:12:02 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-04-08 16:12:02 (GMT) |
commit | 03b825deba94040867c2e1a61ab935abcba9d675 (patch) | |
tree | 86a73bed2acc06b6cd5762ad103b26beac40cbb4 /generic/tclExecute.c | |
parent | 020b89adf6c1706fd36722233e8acb5eb7c8d032 (diff) | |
download | tcl-03b825deba94040867c2e1a61ab935abcba9d675.zip tcl-03b825deba94040867c2e1a61ab935abcba9d675.tar.gz tcl-03b825deba94040867c2e1a61ab935abcba9d675.tar.bz2 |
backport enhanced comments
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 1677a78..0003fb2 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.369 2008/03/18 18:52:07 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.369.2.1 2008/04/08 16:12:02 dgp Exp $ */ #include "tclInt.h" @@ -851,23 +851,36 @@ TclFinalizeExecution(void) /* * Auxiliary code to insure that GrowEvaluationStack always returns correctly - * aligned memory. This assumes that TCL_ALLOCALIGN is a multiple of the - * wordsize 'sizeof(Tcl_Obj *)'. + * aligned memory. + * + * WALLOCALIGN represents the alignment reqs in words, just as TCL_ALLOCALIGN + * represents the reqs in bytes. This assumes that TCL_ALLOCALIGN is a + * multiple of the wordsize 'sizeof(Tcl_Obj *)'. */ #define WALLOCALIGN \ (TCL_ALLOCALIGN/sizeof(Tcl_Obj *)) +/* + * OFFSET computes how many words have to be skipped until the next aligned + * word. Note that we are only interested in the low order bits of ptr, so + * that any possible information loss in PTR2INT is of no consequence. + */ + static inline int OFFSET( void *ptr) { int mask = TCL_ALLOCALIGN-1; int base = PTR2INT(ptr) & mask; - return (TCL_ALLOCALIGN - base)/sizeof(Tcl_Obj**); + return (TCL_ALLOCALIGN - base)/sizeof(Tcl_Obj *); } -#define MEMSTART(markerPtr) \ +/* + * Given a marker, compute where the following aligned memory starts. + */ + +#define MEMSTART(markerPtr) \ ((markerPtr) + OFFSET(markerPtr)) |