summaryrefslogtreecommitdiff
path: root/mark_rts.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-05-08 10:33:48 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-05-08 10:33:48 +0300
commit404b6f264994f0b136a4eba3cb5d5060605a226e (patch)
treedb74840242ee66d98e314a7a5e3b60500b7aab4a /mark_rts.c
parent0ff8f033ccfbd5711b2c17b8b1c056c385c83b6c (diff)
downloadbdwgc-404b6f264994f0b136a4eba3cb5d5060605a226e.tar.gz
Do not merge dynamic root with the existing static one in add_roots_inner
* mark_rts.c [!MSWIN32 && !MSWINCE && !CYGWIN32] (GC_add_roots_inner): If the root already exists and it is static then set the found root to static (if not yet); if dynamic root with the same r_start but different r_tmp is found then add a new root starting from r_end of the found root (instead of extending the found root).
Diffstat (limited to 'mark_rts.c')
-rw-r--r--mark_rts.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mark_rts.c b/mark_rts.c
index a179effb..2997024d 100644
--- a/mark_rts.c
+++ b/mark_rts.c
@@ -236,12 +236,18 @@ void GC_add_roots_inner(ptr_t b, ptr_t e, GC_bool tmp)
struct roots * old = (struct roots *)GC_roots_present(b);
if (old != 0) {
- if ((word)e <= (word)old->r_end)
+ if ((word)e <= (word)old->r_end) {
+ old -> r_tmp &= tmp;
return; /* already there */
- /* else extend */
- GC_root_size += e - old -> r_end;
- old -> r_end = e;
- return;
+ }
+ if (old -> r_tmp == tmp || !tmp) {
+ /* Extend the existing root. */
+ GC_root_size += e - old -> r_end;
+ old -> r_end = e;
+ old -> r_tmp = tmp;
+ return;
+ }
+ b = old -> r_end;
}
}
# endif