Artifacts Associated With Ticket 1299153fffffffff
Ticket change [0ea9279db6] (rid 94655) by dgp on 2005-09-22 21:37:51:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The libtommath library has a configuration value MP_PREC that specifies the minimum number of mp_digits in an mp_int. The default value of MP_PREC is 64. This means that once an integer value is too large to fit in a Tcl_WideInt, the storage requirements balloon from 8 bytes to hold 64 bits to 256 bytes just for the digits array holding 64 4-byte mp_digits to hold 65 bits. Even worse is the Tcl routine TclBNInitBignumFromLong() which calls mp_init_size(). Through some quirkiness in libtommath, mp_init_size actually creates an mp_int with a minimum of 2*MP_PREC mp_digits. So when we're explicitly creating an mp_int to hold a long value -- one we know will fit in two mp_digits -- we're forced to allocate 128 mp_digits, or a whopping 512 bytes, just for the digits array. These defaults may be appropriate for some clients of libtommath, but they're not a good fit for Tcl to require such an explosion of memory expense just to cross over into mp_int's. There is an MP_LOW_MEM configuration that sets MP_PREC to 8 rather than 64. That would help a lot, but even that seems too abrupt across the wide->bignum transition. A value of MP_PREC = 4 would seem to be a better fit for Tcl's bignum needs. Even with that revision, we should probably rewrite TclBNInitBignumFromLong to avoid making a call to mp_init_size(). Other mp_init_size() callers ought to be examined as well.
- foundin initialized to: "obsolete: 8.5a4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "10. Objects"
- title initialized to: "MP_PREC is too large"
- type initialized to: "Bug"
Ticket change [fb24fca8a3] (rid 92000) by dgp on 2005-09-23 23:47:52:
- icomment:
Logged In: YES user_id=80530 -DMP_PREC=4 added to Makefiles on the numerics branch.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c95d573562] (rid 122269) by dgp on 2005-10-14 00:47:40:
- assignee changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 fixed by the TIP 237 merge.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"
Ticket change [5f6932b77b] (rid 115820) by dgp on 2005-10-14 00:47:41:
- closedate changed to: "2005-10-13T17:47:41"
- closer changed to: "dgp"