alexandru <alexandru.dadalau@meshparts.de> wrote:
Will there be a fix for the 2GB size limit that a string representation
have in Tcl?
Maybe already fixed in Tcl 9.0?
Yes, that's one of the reasons for switching to tcl9 as soon as
possible.
Andreas Leitgeb <avl@logic.at> wrote:
alexandru <alexandru.dadalau@meshparts.de> wrote:
Will there be a fix for the 2GB size limit that a string representation
have in Tcl?
Maybe already fixed in Tcl 9.0?
Yes, that's one of the reasons for switching to tcl9 as soon as
possible.
What is the new larger "limit" in Tcl9?
Andreas Leitgeb <avl@logic.at> wrote:
alexandru <alexandru.dadalau@meshparts.de> wrote:
Will there be a fix for the 2GB size limit that a string representation
have in Tcl?
Maybe already fixed in Tcl 9.0?
Yes, that's one of the reasons for switching to tcl9 as soon as
possible.
What is the new larger "limit" in Tcl9?
In 9.0 the type of the 'length' member of the Tcl_Obj struct (the number of bytes at '*bytes' member, not including the terminating null) has changed from int to ptrdiff_t, so it will remain (1<<31)-1 => 2147483647 bytes on
32 bit platforms (unsurprisingly) and (1<<63)-1 => 9223372036854775807
(9,22 exabyte) on 64 bit platforms.
IIUC that's also the (new) number of elements for a Tcl list.
In practice the number will be less, since the length of the
string representation of such list will hit the '*bytes' max
length first.
Emiliano <emiliano@example.invalid> wrote:
In 9.0 the type of the 'length' member of the Tcl_Obj struct (the number of bytes at '*bytes' member, not including the terminating null) has changed from int to ptrdiff_t, so it will remain (1<<31)-1 => 2147483647 bytes on 32 bit platforms (unsurprisingly) and (1<<63)-1 => 9223372036854775807 (9,22 exabyte) on 64 bit platforms.
My hearsay was "generally 64 bit (minus the sign-bit)".
Are you sure that length-type is *always* ptrdiff_t, and
that this may be 32bit?
The "64bit'ness" of a platform is also a bit more complicated...
There are platforms, where pointers are 64bit, but ints are
still 32 (despite machine words being all 64bit) - in those
cases, I'd expect ptrdiff_t to be 64 bit, but on a real old
32bit machine, I don't really know for sure...
IIUC that's also the (new) number of elements for a Tcl list.
In practice the number will be less, since the length of the
string representation of such list will hit the '*bytes' max
length first.
Not all lists are ever turned to string-rep. While they are
semantically "just strings", well written programs can avoid
the actual obtainment of the string rep, at least for those
really long lists that may be relevant here.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 991 |
Nodes: | 10 (0 / 10) |
Uptime: | 119:44:39 |
Calls: | 12,958 |
Files: | 186,574 |
Messages: | 3,265,639 |