result->len = (word)result_len;
result->left = x;
result->right = y;
- GC_end_stubborn_change(result);
+ GC_END_STUBBORN_CHANGE(result);
+ GC_reachable_here(x);
+ GC_reachable_here(y);
if (depth >= MAX_DEPTH) {
return(CORD_balance((CORD)result));
} else {
result->len = (word)result_len;
result->left = x;
result->right = y;
- GC_end_stubborn_change(result);
+ GC_END_STUBBORN_CHANGE(result);
+ GC_reachable_here(x);
+ GC_reachable_here(y);
if (depth >= MAX_DEPTH) {
return(CORD_balance((CORD)result));
} else {
result->len = (word)len;
result->fn = fn;
result->client_data = client_data;
- GC_end_stubborn_change(result);
+ GC_END_STUBBORN_CHANGE(result);
+ GC_reachable_here(client_data);
return (CordRep *)result;
}
}
if (sa == 0) OUT_OF_MEMORY;
sa->sa_cord = (CordRep *)x;
sa->sa_index = i;
- GC_end_stubborn_change(sa);
+ GC_END_STUBBORN_CHANGE(sa);
+ GC_reachable_here(x);
result = CORD_from_fn_inner(f, (void *)sa, n);
if ((CORD)result != CORD_EMPTY && 0 == result -> function.null)
result -> function.header = SUBSTR_HDR;
new_cache -> tag = DIV_LINE_SZ(file_pos);
/* Store barrier goes here. */
ATOMIC_WRITE(state -> lf_cache[line_no], new_cache);
- GC_end_stubborn_change((/* no volatile */ void *)(state -> lf_cache
+ GC_END_STUBBORN_CHANGE((/* no volatile */ void *)(state -> lf_cache
+ line_no));
state -> lf_current = line_start + LINE_SZ;
return (void *)((GC_word)new_cache->data[MOD_LINE_SZ(file_pos)]);
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);
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++;
}
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;
}
}
}
screen[i] = s;
- GC_end_stubborn_change(screen + i);
+ GC_END_STUBBORN_CHANGE(screen + i);
+ GC_reachable_here(s);
}
}
#else
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();
}