Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2023-04-23
06:13 • Closed ticket [d90fee06d0]: Uncompiled lassign fails on large lists with memory ... artifact: a121f1a39a user: apnadkarni
05:23
Merge 8.7 - [d90fee06d0] (lassign) and [203792a48c] (Utf32ToUtf) check-in: 8b91a4a3c6 user: apnadkarni tags: trunk, main
04:18
Bug [d90fee06d0] - lassign performance check-in: 3509f8a4db user: apnadkarni tags: core-8-branch
2023-04-22
09:53 • Ticket [d90fee06d0] Uncompiled lassign fails on large lists with memory allocati... artifact: 3678ba4418 user: apnadkarni
2023-04-12
16:16 • Ticket [d90fee06d0]: 4 changes artifact: 568862c20b user: apnadkarni
2023-04-11
16:18 • New ticket [d90fee06d0]. artifact: df71d0a982 user: apnadkarni

Uncompiled lassign fails on large lists with memory allocation failure

Closed / Fixedd90fee06d04a0d52397dfba79e263d932f685707Created 4 years agoUpdated 4 years ago
Descriptionmarkdown2023-04-11 16:18:52

The following works

% set l [testbigdata list 0x100000001]; llength $l
4294967297
% lassign $l x ; set x
0

The following fails with a memory allocation failure.

% set lassign lassign
lassign
% llength $l
4294967297
% $lassign $l x; set x

The difference is because the compiled version makes use of the ListSpan internal representation while Tcl_LassignObjCmd does not.

Referenced by2
apnadkarni Ticket [d90fee06d0]: 4 changes [History diff]2023-04-12 16:16:25
apnadkarniplain2023-04-22 09:53:21
Although 8.7 does not have the memory issue (it can't support such large allocations anyways), it also would benefit from using list ranges for performance reasons.
apnadkarniplain2023-04-23 06:13:27
Fixed in [3509f8a4db] (8.7) and [8b91a4a3c6] (9.0).
Log in (anonymous is fine) to add a comment.