diff options
author | dgp <dgp@users.sourceforge.net> | 2009-10-29 18:34:59 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2009-10-29 18:34:59 (GMT) |
commit | efa238ed7afcfce380fc18e6c869836f3f451bf9 (patch) | |
tree | 50f7f10460c335d18c31566ad79781cd0e350db0 /generic/tcl.h | |
parent | 7ba094d5c64eb844c4fec27beb598cf43c90b821 (diff) | |
download | tcl-efa238ed7afcfce380fc18e6c869836f3f451bf9.zip tcl-efa238ed7afcfce380fc18e6c869836f3f451bf9.tar.gz tcl-efa238ed7afcfce380fc18e6c869836f3f451bf9.tar.bz2 |
* generic/tcl.h: Changed the typedef for the mp_digit type
from:
typedef unsigned long mp_digit;
to:
typedef unsigned int mp_digit;
For 32-bit builds where "long" and "int" are two names for the same
thing, this is no change at all. For 64-bit builds, though, this
causes the dp[] array of an mp_int to be made up of 32-bit elements
instead of 64-bit elements. This is a huge improvement because details
elsewhere in the mp_int implementation cause only 28 bits of each
element to be actually used storing number data. Without this change
bignums are over 50% wasted space on 64-bit systems. [Bug 2800740].
***POTENTIAL INCOMPATIBILITY***
For 64-bit builds, callers of routines with (mp_digit) or (mp_digit *)
arguments *will*, and callers of routines with (mp_int *) arguments
*may* suffer both binary and stubs incompatibilities with Tcl releases
8.5.0 - 8.5.7. Such possibilities should be checked, and if such
incompatibilities are present, suitable [package require] requirements
on the Tcl release should be put in place to keep such built code
[load]-ing only in Tcl interps that are compatible.
Diffstat (limited to 'generic/tcl.h')
-rw-r--r-- | generic/tcl.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index ad3021e..87eebf8 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -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: tcl.h,v 1.254.2.11 2009/04/29 15:47:05 patthoyts Exp $ + * RCS: @(#) $Id: tcl.h,v 1.254.2.12 2009/10/29 18:34:59 dgp Exp $ */ #ifndef _TCL @@ -2179,14 +2179,10 @@ typedef void (Tcl_LimitHandlerProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp)); typedef void (Tcl_LimitHandlerDeleteProc) _ANSI_ARGS_((ClientData clientData)); -#ifndef MP_INT_DECLARED typedef struct mp_int mp_int; #define MP_INT_DECLARED -#endif -#ifndef MP_DIGIT_DECLARED -typedef unsigned long mp_digit; +typedef unsigned int mp_digit; #define MP_DIGIT_DECLARED -#endif /* * The following constant is used to test for older versions of Tcl in the |