Fossil SCM
Changed the encoding of the values stored in DEPC. Keep only start/end of the range, not the list of all positions in it. That caused the memory-blowup.
Commit
59b54efab51989bb12a820361630b357877c3457
Parent
530168ec30a1e9f…
1 file changed
+14
-5
+14
-5
| --- tools/cvs2fossil/lib/c2f_prev.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_prev.tcl | ||
| @@ -852,21 +852,20 @@ | ||
| 852 | 852 | foreach {rid children} [array get dependencies] { |
| 853 | 853 | foreach child $children { |
| 854 | 854 | set dkey [list $rid $child] |
| 855 | 855 | set start $pos($rid) |
| 856 | 856 | set end $pos($child) |
| 857 | - set crosses {} | |
| 858 | 857 | |
| 859 | 858 | if {$start > $end} { |
| 859 | + set crosses [list $end [expr {$start-1}]] | |
| 860 | 860 | while {$end < $start} { |
| 861 | - lappend crosses $end | |
| 862 | 861 | incr cross($end) |
| 863 | 862 | incr end |
| 864 | 863 | } |
| 865 | 864 | } else { |
| 865 | + set crosses [list $start [expr {$end-1}]] | |
| 866 | 866 | while {$start < $end} { |
| 867 | - lappend crosses $start | |
| 868 | 867 | incr cross($start) |
| 869 | 868 | incr start |
| 870 | 869 | } |
| 871 | 870 | } |
| 872 | 871 | set depc($dkey) $crosses |
| @@ -974,11 +973,18 @@ | ||
| 974 | 973 | # the cross information so that the break finder has accurate |
| 975 | 974 | # data when we look at the generated fragments. |
| 976 | 975 | |
| 977 | 976 | set six [log visible? 6] |
| 978 | 977 | |
| 979 | - foreach {dep range} [array get depc] { | |
| 978 | + # Note: The loop below could be made faster by keeping a map | |
| 979 | + # from positions to the dependencies crossing. An extension of | |
| 980 | + # CROSS, i.e. list of dependencies, counter is implied. Takes | |
| 981 | + # a lot more memory however, and takes time to update here | |
| 982 | + # (The inner loop is not incr -1, but ldelete). | |
| 983 | + | |
| 984 | + foreach dep [array names depc] { | |
| 985 | + set range $depc($dep) | |
| 980 | 986 | # Check all dependencies still known, take their range and |
| 981 | 987 | # see if the break location falls within. |
| 982 | 988 | |
| 983 | 989 | Border $range s e |
| 984 | 990 | if {$location < $s} continue ; # break before range, ignore |
| @@ -986,11 +992,14 @@ | ||
| 986 | 992 | |
| 987 | 993 | # This dependency crosses the break location. We remove it |
| 988 | 994 | # from the crossings counters, and then also from the set |
| 989 | 995 | # of known dependencies, as we are done with it. |
| 990 | 996 | |
| 991 | - foreach loc $depc($dep) { incr cross($loc) -1 } | |
| 997 | + Border $depc($dep) ds de | |
| 998 | + for {set loc $ds} {$loc <= $de} {incr loc} { | |
| 999 | + incr cross($loc) -1 | |
| 1000 | + } | |
| 992 | 1001 | unset depc($dep) |
| 993 | 1002 | |
| 994 | 1003 | if {!$six} continue |
| 995 | 1004 | |
| 996 | 1005 | struct::list assign $dep parent child |
| 997 | 1006 |
| --- tools/cvs2fossil/lib/c2f_prev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_prev.tcl | |
| @@ -852,21 +852,20 @@ | |
| 852 | foreach {rid children} [array get dependencies] { |
| 853 | foreach child $children { |
| 854 | set dkey [list $rid $child] |
| 855 | set start $pos($rid) |
| 856 | set end $pos($child) |
| 857 | set crosses {} |
| 858 | |
| 859 | if {$start > $end} { |
| 860 | while {$end < $start} { |
| 861 | lappend crosses $end |
| 862 | incr cross($end) |
| 863 | incr end |
| 864 | } |
| 865 | } else { |
| 866 | while {$start < $end} { |
| 867 | lappend crosses $start |
| 868 | incr cross($start) |
| 869 | incr start |
| 870 | } |
| 871 | } |
| 872 | set depc($dkey) $crosses |
| @@ -974,11 +973,18 @@ | |
| 974 | # the cross information so that the break finder has accurate |
| 975 | # data when we look at the generated fragments. |
| 976 | |
| 977 | set six [log visible? 6] |
| 978 | |
| 979 | foreach {dep range} [array get depc] { |
| 980 | # Check all dependencies still known, take their range and |
| 981 | # see if the break location falls within. |
| 982 | |
| 983 | Border $range s e |
| 984 | if {$location < $s} continue ; # break before range, ignore |
| @@ -986,11 +992,14 @@ | |
| 986 | |
| 987 | # This dependency crosses the break location. We remove it |
| 988 | # from the crossings counters, and then also from the set |
| 989 | # of known dependencies, as we are done with it. |
| 990 | |
| 991 | foreach loc $depc($dep) { incr cross($loc) -1 } |
| 992 | unset depc($dep) |
| 993 | |
| 994 | if {!$six} continue |
| 995 | |
| 996 | struct::list assign $dep parent child |
| 997 |
| --- tools/cvs2fossil/lib/c2f_prev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_prev.tcl | |
| @@ -852,21 +852,20 @@ | |
| 852 | foreach {rid children} [array get dependencies] { |
| 853 | foreach child $children { |
| 854 | set dkey [list $rid $child] |
| 855 | set start $pos($rid) |
| 856 | set end $pos($child) |
| 857 | |
| 858 | if {$start > $end} { |
| 859 | set crosses [list $end [expr {$start-1}]] |
| 860 | while {$end < $start} { |
| 861 | incr cross($end) |
| 862 | incr end |
| 863 | } |
| 864 | } else { |
| 865 | set crosses [list $start [expr {$end-1}]] |
| 866 | while {$start < $end} { |
| 867 | incr cross($start) |
| 868 | incr start |
| 869 | } |
| 870 | } |
| 871 | set depc($dkey) $crosses |
| @@ -974,11 +973,18 @@ | |
| 973 | # the cross information so that the break finder has accurate |
| 974 | # data when we look at the generated fragments. |
| 975 | |
| 976 | set six [log visible? 6] |
| 977 | |
| 978 | # Note: The loop below could be made faster by keeping a map |
| 979 | # from positions to the dependencies crossing. An extension of |
| 980 | # CROSS, i.e. list of dependencies, counter is implied. Takes |
| 981 | # a lot more memory however, and takes time to update here |
| 982 | # (The inner loop is not incr -1, but ldelete). |
| 983 | |
| 984 | foreach dep [array names depc] { |
| 985 | set range $depc($dep) |
| 986 | # Check all dependencies still known, take their range and |
| 987 | # see if the break location falls within. |
| 988 | |
| 989 | Border $range s e |
| 990 | if {$location < $s} continue ; # break before range, ignore |
| @@ -986,11 +992,14 @@ | |
| 992 | |
| 993 | # This dependency crosses the break location. We remove it |
| 994 | # from the crossings counters, and then also from the set |
| 995 | # of known dependencies, as we are done with it. |
| 996 | |
| 997 | Border $depc($dep) ds de |
| 998 | for {set loc $ds} {$loc <= $de} {incr loc} { |
| 999 | incr cross($loc) -1 |
| 1000 | } |
| 1001 | unset depc($dep) |
| 1002 | |
| 1003 | if {!$six} continue |
| 1004 | |
| 1005 | struct::list assign $dep parent child |
| 1006 |