Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6772f1878960d4f9a58e7e4103df2ef29c2edcbf49125c5698304e720d304080
Ticket: 92aeb847f9b92cfbd281e9263be3f019ad59192b
proc with more than 2**31 variables
User & Date: jan.nijtmans on 2025-04-14 07:57:45
Changes

  1. icomment:
    After better fix:
    <pre>
    $ ./tclsh
    % proc xx [lrepeat 0x100000000 x] {}
    total mallocs              163959265
    total frees                   130503
    current packets allocated  163828762
    current bytes allocated   41896099036
    maximum packets allocated  163828762
    maximum bytes allocated   41896099036
    procedure "xx": memory error
    %
    </pre>
    
    Actually, it depends where the allocation error occurs. It might happen
    in a Tcl_Alloc(), it also might happen in Tcl_CreateHashEntry().
    
    In the first case, we might use Tcl_AttemptAlloc() and do a proper cleanup. In the other case, we would need a Tcl_AttemptCreateHashEntry() (TIP!)
    
  2. login: "jan.nijtmans"
  3. mimetype: "text/x-fossil-wiki"