diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-05-08 10:33:48 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-05-08 10:33:48 +0300 |
commit | 404b6f264994f0b136a4eba3cb5d5060605a226e (patch) | |
tree | db74840242ee66d98e314a7a5e3b60500b7aab4a /mark_rts.c | |
parent | 0ff8f033ccfbd5711b2c17b8b1c056c385c83b6c (diff) | |
download | bdwgc-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.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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 |