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.

aku 2008-02-24 00:14 trunk
Commit 59b54efab51989bb12a820361630b357877c3457
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -852,21 +852,20 @@
852852
foreach {rid children} [array get dependencies] {
853853
foreach child $children {
854854
set dkey [list $rid $child]
855855
set start $pos($rid)
856856
set end $pos($child)
857
- set crosses {}
858857
859858
if {$start > $end} {
859
+ set crosses [list $end [expr {$start-1}]]
860860
while {$end < $start} {
861
- lappend crosses $end
862861
incr cross($end)
863862
incr end
864863
}
865864
} else {
865
+ set crosses [list $start [expr {$end-1}]]
866866
while {$start < $end} {
867
- lappend crosses $start
868867
incr cross($start)
869868
incr start
870869
}
871870
}
872871
set depc($dkey) $crosses
@@ -974,11 +973,18 @@
974973
# the cross information so that the break finder has accurate
975974
# data when we look at the generated fragments.
976975
977976
set six [log visible? 6]
978977
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)
980986
# Check all dependencies still known, take their range and
981987
# see if the break location falls within.
982988
983989
Border $range s e
984990
if {$location < $s} continue ; # break before range, ignore
@@ -986,11 +992,14 @@
986992
987993
# This dependency crosses the break location. We remove it
988994
# from the crossings counters, and then also from the set
989995
# of known dependencies, as we are done with it.
990996
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
+ }
9921001
unset depc($dep)
9931002
9941003
if {!$six} continue
9951004
9961005
struct::list assign $dep parent child
9971006
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button