[prev in list] [next in list] [prev in thread] [next in thread]
List: sbcl-commits
Subject: [Sbcl-commits] master: Don't define conservative_root_p() if gencgc is precise
From: "Douglas Katzman" <snuglas () users ! sourceforge ! net>
Date: 2017-04-30 13:02:03
Message-ID: 1493557323.346073.15696 () sfp-scm-6 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]
The branch "master" has been updated in SBCL:
via 04bfe9f57ab0ab6a2ca4d0d1cb852e7576479593 (commit)
from 30fa77564948f9131302ac82dfd4de0529d3e645 (commit)
- Log -----------------------------------------------------------------
commit 04bfe9f57ab0ab6a2ca4d0d1cb852e7576479593
Author: Douglas Katzman <dougk@google.com>
Date: Sun Apr 30 08:42:10 2017 -0400
Don't define conservative_root_p() if gencgc is precise
---
src/runtime/gencgc.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c
index 423608f..04caf46 100644
--- a/src/runtime/gencgc.c
+++ b/src/runtime/gencgc.c
@@ -1939,6 +1939,7 @@ search_dynamic_space(void *pointer)
return gc_search_space(start, pointer);
}
+#ifndef GENCGC_IS_PRECISE
// Return the starting address of the object containing 'addr'
// if and only if the object is one which would be evacuated from 'from_space'
// were it allowed to be either discarded as garbage or moved.
@@ -1948,16 +1949,6 @@ search_dynamic_space(void *pointer)
static lispobj*
conservative_root_p(void *addr, page_index_t addr_page_index)
{
-#ifdef GENCGC_IS_PRECISE
- /* If we're in precise gencgc (non-x86oid as of this writing) then
- * we are only called on valid object pointers in the first place,
- * so we just have to do a bounds-check against the heap, a
- * generation check, and the already-pinned check. */
- if ((page_table[addr_page_index].gen != from_space)
- || (page_table[addr_page_index].dont_move != 0))
- return 0;
- return (lispobj*)1;
-#else
/* quick check 1: Address is quite likely to have been invalid. */
if (page_free_p(addr_page_index)
|| (page_bytes_used(addr_page_index) == 0)
@@ -1997,8 +1988,8 @@ conservative_root_p(void *addr, page_index_t addr_page_index)
return 0;
return object_start;
-#endif
}
+#endif
/* Adjust large bignum and vector objects. This will adjust the
* allocated region if the size has shrunk, and move unboxed objects
@@ -2300,11 +2291,22 @@ preserve_pointer(void *addr)
}
#endif
page_index_t addr_page_index = find_page_index(addr);
+
+#ifdef GENCGC_IS_PRECISE
+ /* If we're in precise gencgc (non-x86oid as of this writing) then
+ * we are only called on valid object pointers in the first place,
+ * so we just have to do a bounds-check against the heap, a
+ * generation check, and the already-pinned check. */
+ if (addr_page_index == -1
+ || (page_table[addr_page_index].gen != from_space)
+ || page_table[addr_page_index].dont_move)
+ return;
+#else
lispobj *object_start;
-
if (addr_page_index == -1
|| (object_start = conservative_root_p(addr, addr_page_index)) == 0)
return;
+#endif
/* (Now that we know that addr_page_index is in range, it's
* safe to index into page_table[] with it.) */
-----------------------------------------------------------------------
hooks/post-receive
--
SBCL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sbcl-commits mailing list
Sbcl-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic