master: Halve the size of immobile cards

snuglas via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  e972a1a2b8098cd686db8b8e345af8c040401f0e (commit)
      from  1da3c086e78ecd94ef28c255d8692f147ac41006 (commit)

- Log -----------------------------------------------------------------
commit e972a1a2b8098cd686db8b8e345af8c040401f0e
Author: Douglas Katzman <[email protected]>
Date:   Tue Apr 7 23:09:56 2026 -0400

    Halve the size of immobile cards
---
 src/compiler/x86-64/parms.lisp | 2 +-
 tests/checkheap.test.sh        | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/compiler/x86-64/parms.lisp b/src/compiler/x86-64/parms.lisp
index 8599d6bbb..463d8e002 100644
--- a/src/compiler/x86-64/parms.lisp
+++ b/src/compiler/x86-64/parms.lisp
@@ -42,7 +42,7 @@
 ;;; the start of objects.
 (defconstant gencgc-alloc-granularity 0)
 ;;; The card size for immobile/low space
-(defconstant immobile-card-bytes 4096)
+(defconstant immobile-card-bytes 2048)
 
 ;;; ### Note: 'lispword' always means 8 bytes, and 'word' usually means
 ;;; the same as 'lispword', except in the assembler and disassembler,
diff --git a/tests/checkheap.test.sh b/tests/checkheap.test.sh
index e010dbb23..ac130f211 100644
--- a/tests/checkheap.test.sh
+++ b/tests/checkheap.test.sh
@@ -13,8 +13,8 @@ then
   stdout=$TEST_DIRECTORY/$TEST_FILESTEM.out
   stderr=$TEST_DIRECTORY/$TEST_FILESTEM.err
   run_sbcl >$stdout 2>$stderr <<EOF
-;; Immobile pages have physical protection, so it's unlikely that it would be wrong.
-;; However, the verifier was never actually checking.
+;; Mark a page as logically protected when it should not be, and confirm that
+;; the heap invariant checker finds an error.
 (assert (= (sb-kernel:generation-of '*posix-argv*) sb-vm:+pseudo-static-generation+))
 (assert (< (sb-kernel:generation-of *posix-argv*) sb-vm:+pseudo-static-generation+))
 (define-alien-type nil
@@ -29,7 +29,7 @@ then
 (setf (extern-alien "pre_verify_gen_0" char) 1)
 (let ((i (floor (- (sb-kernel:get-lisp-obj-address '*posix-argv*)
                    sb-vm:fixedobj-space-start)
-                4096)))
+                sb-vm:immobile-card-bytes)))
   ;; Mark it as-if write-protected (though without using mprotect)
   ;; This constant is defined in immobile-space.c: #define WRITE_PROTECT 0x80
   (setf (slot (deref fixedobj-pages i) 'flags) 128)

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


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.