diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2008-03-18 18:52:07 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2008-03-18 18:52:07 (GMT) |
commit | 1d44a174235c0c57c938cc88cff5ec088146d4fa (patch) | |
tree | 46c2eab4b1069a60545a9bb3ad396ab12aa7c4a1 /generic | |
parent | 6b95d3e5eb8086185b29be9df9f1ecf1661c3db6 (diff) | |
download | tcl-1d44a174235c0c57c938cc88cff5ec088146d4fa.zip tcl-1d44a174235c0c57c938cc88cff5ec088146d4fa.tar.gz tcl-1d44a174235c0c57c938cc88cff5ec088146d4fa.tar.bz2 |
fix and simplify the OFFSET computation for TclStackAlloc
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclExecute.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 31df1a7..1677a78 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.368 2008/03/18 17:58:30 dgp Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.369 2008/03/18 18:52:07 msofer Exp $ */ #include "tclInt.h" @@ -860,12 +860,11 @@ TclFinalizeExecution(void) static inline int OFFSET( - Tcl_Obj **markerPtr) + void *ptr) { int mask = TCL_ALLOCALIGN-1; - int base = PTR2INT(markerPtr) & 0xFFFFFF; - int new = (base + TCL_ALLOCALIGN) & ~mask; - return (new - base); + int base = PTR2INT(ptr) & mask; + return (TCL_ALLOCALIGN - base)/sizeof(Tcl_Obj**); } #define MEMSTART(markerPtr) \ |