[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-commits
Subject:    [Sbcl-commits] master: Fix scavenge_generations.
From:       "stassats" <stassats () users ! sourceforge ! net>
Date:       2017-03-30 0:18:41
Message-ID: 1490833122.196029.9199 () sfp-scm-3 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

The branch "master" has been updated in SBCL:
       via  700c22ad97d77f0d02f719ba8459877e095fbccd (commit)
      from  abce2658755319b8e824ff4cb60440b3c67a951a (commit)

- Log -----------------------------------------------------------------
commit 700c22ad97d77f0d02f719ba8459877e095fbccd
Author: Stas Boukarev <stassats@gmail.com>
Date:   Thu Mar 30 03:07:59 2017 +0300

    Fix scavenge_generations.
    
    scavenge() wants words, not bytes.
---
 src/runtime/gencgc.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c
index 3912838..412023f 100644
--- a/src/runtime/gencgc.c
+++ b/src/runtime/gencgc.c
@@ -2477,7 +2477,7 @@ static inline boolean large_simple_vector_p(page_index_t page) {
         return 0;
     lispobj object = *(lispobj *)page_address(page);
     return widetag_of(object) == SIMPLE_VECTOR_WIDETAG &&
-        ((HeaderValue(object) & 0xFF) == subtype_VectorNormal);
+        (HeaderValue(object) & 0xFF) == subtype_VectorNormal;
 
 }
 
@@ -2545,19 +2545,21 @@ scavenge_generations(generation_index_t from, generation_index_t to)
                  * worthwile */
                 if (!page_table[i].write_protected) {
                     scavenge((lispobj*)page_address(i) + 2,
-                             GENCGC_CARD_BYTES - 2);
+                             (GENCGC_CARD_BYTES - 2) / N_WORD_BYTES);
                     update_page_write_prot(i);
                 }
                 for (last_page = i + 1; ; last_page++) {
+                    lispobj* start = page_address(last_page);
+                    write_protected = page_table[last_page].write_protected;
                     if (page_ends_contiguous_block_p(last_page, generation)) {
-                        if (!page_table[last_page].write_protected) {
-                            scavenge(page_address(last_page), page_bytes_used(last_page));
+                        if (!write_protected) {
+                            scavenge(start, page_bytes_used(last_page) / N_WORD_BYTES);
                             update_page_write_prot(last_page);
                         }
                         break;
                     }
-                    if (!page_table[last_page].write_protected) {
-                        scavenge(page_address(last_page), GENCGC_CARD_BYTES);
+                    if (!write_protected) {
+                        scavenge(start, GENCGC_CARD_BYTES / N_WORD_BYTES);
                         update_page_write_prot(last_page);
                     }
                 }

-----------------------------------------------------------------------


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