diff options
Diffstat (limited to 'cord/tests/de.c')
-rw-r--r-- | cord/tests/de.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/cord/tests/de.c b/cord/tests/de.c index adfd0e38..522da919 100644 --- a/cord/tests/de.c +++ b/cord/tests/de.c @@ -137,8 +137,11 @@ void prune_map(void) do { current_map_size++; if (map -> line < start_line - LINES && map -> previous != 0) { - map -> previous = map -> previous -> previous; - GC_end_stubborn_change(map); + line_map pred = map -> previous -> previous; + + map -> previous = pred; + GC_END_STUBBORN_CHANGE(map); + GC_reachable_here(pred); } map = map -> previous; } while (map != 0); @@ -148,13 +151,16 @@ void prune_map(void) void add_map(int line_arg, size_t pos) { line_map new_map = GC_NEW(struct LineMapRep); + line_map cur_map; if (NULL == new_map) OUT_OF_MEMORY; if (current_map_size >= MAX_MAP_SIZE) prune_map(); new_map -> line = line_arg; new_map -> pos = pos; - new_map -> previous = current_map; - GC_end_stubborn_change(new_map); + cur_map = current_map; + new_map -> previous = cur_map; + GC_END_STUBBORN_CHANGE(new_map); + GC_reachable_here(cur_map); current_map = new_map; current_map_size++; } @@ -200,10 +206,10 @@ void add_hist(CORD s) new_file -> file_contents = current = s; current_len = CORD_len(s); new_file -> previous = now; - GC_end_stubborn_change(new_file); + GC_END_STUBBORN_CHANGE(new_file); if (now != NULL) { now -> map = current_map; - GC_end_stubborn_change(now); + GC_END_STUBBORN_CHANGE(now); } now = new_file; } @@ -255,7 +261,8 @@ void replace_line(int i, CORD s) } } screen[i] = s; - GC_end_stubborn_change(screen + i); + GC_END_STUBBORN_CHANGE(screen + i); + GC_reachable_here(s); } } #else @@ -577,7 +584,7 @@ void generic_init(void) add_hist(initial); now -> map = current_map; now -> previous = now; /* Can't back up further: beginning of the world */ - GC_end_stubborn_change(now); + GC_END_STUBBORN_CHANGE(now); need_redisplay = ALL; fix_cursor(); } |