diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2007-12-17 15:28:25 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2007-12-17 15:28:25 (GMT) |
commit | 5839e20e37267d1257342d2850e98b3ba1123cf0 (patch) | |
tree | 49d9048cda9d5fbd98c4370922f050be7ee89dfe /generic/tclThreadAlloc.c | |
parent | 30ac6357580feb97c6b19c49d1aa724e32a3faf8 (diff) | |
download | tcl-5839e20e37267d1257342d2850e98b3ba1123cf0.zip tcl-5839e20e37267d1257342d2850e98b3ba1123cf0.tar.gz tcl-5839e20e37267d1257342d2850e98b3ba1123cf0.tar.bz2 |
* generic/tclAlloc.c:
* generic/tclExecute.c:
* generic/tclInt.h:
* generic/tclThreadAlloc.c: Fix alignment for memory returned by
TclStackAlloc; insure that all memory allocators align to 16-byte
boundaries on 64 bit platforms [Bug 1851832, 1851524]
Diffstat (limited to 'generic/tclThreadAlloc.c')
-rwxr-xr-x | generic/tclThreadAlloc.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c index 911ba07..3309058 100755 --- a/generic/tclThreadAlloc.c +++ b/generic/tclThreadAlloc.c @@ -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: tclThreadAlloc.c,v 1.24 2007/12/13 15:23:20 dgp Exp $ + * RCS: @(#) $Id: tclThreadAlloc.c,v 1.25 2007/12/17 15:28:28 msofer Exp $ */ #include "tclInt.h" @@ -40,16 +40,6 @@ #define NOBJHIGH 1200 /* - * Alignment for allocated memory. - */ - -#if defined(__APPLE__) -#define ALLOCALIGN 16 -#else -#define ALLOCALIGN 8 -#endif - -/* * The following union stores accounting information for each block including * two small magic numbers and a bucket number when in use or a next pointer * when free. The original requested size (not including the Block overhead) @@ -69,7 +59,7 @@ typedef union Block { } u; size_t reqSize; /* Requested allocation size. */ } b; - unsigned char padding[ALLOCALIGN]; + unsigned char padding[TCL_ALLOCALIGN]; } Block; #define nextBlock b.u.next #define sourceBucket b.u.s.bucket @@ -83,7 +73,7 @@ typedef union Block { * of buckets in the bucket cache. */ -#define MINALLOC ((sizeof(Block) + 8 + (ALLOCALIGN-1)) & ~(ALLOCALIGN-1)) +#define MINALLOC ((sizeof(Block) + 8 + (TCL_ALLOCALIGN-1)) & ~(TCL_ALLOCALIGN-1)) #define NBUCKETS (11 - (MINALLOC >> 5)) #define MAXALLOC (MINALLOC << (NBUCKETS - 1)) |