export DYNAMIC-SPACE-SIZE from SB-EXT
[sbcl.git] / src / code / gc.lisp
index bc5c920..e1ebb73 100644 (file)
@@ -25,7 +25,7 @@
 (declaim (inline dynamic-usage))
 #!+gencgc
 (defun dynamic-usage ()
-  (sb!alien:extern-alien "bytes_allocated" sb!alien:unsigned-long))
+  (sb!alien:extern-alien "bytes_allocated" os-vm-size-t))
 #!-gencgc
 (defun dynamic-usage ()
   (the (unsigned-byte 32)
@@ -176,7 +176,8 @@ NIL as the pathname."
         (native-pathname (cast val c-string)))))
   (declaim (inline dynamic-space-size))
   (defun dynamic-space-size ()
-    (sb!alien:extern-alien "dynamic_space_size" sb!alien:unsigned-long)))
+    "Size of the dynamic space in bytes."
+    (sb!alien:extern-alien "dynamic_space_size" os-vm-size-t)))
 \f
 ;;;; SUB-GC
 
@@ -339,14 +340,17 @@ NIL as the pathname."
 (defun bytes-consed-between-gcs ()
   #!+sb-doc
   "The amount of memory that will be allocated before the next garbage
-collection is initiated. This can be set with SETF."
-  (sb!alien:extern-alien "bytes_consed_between_gcs"
-                         (sb!alien:unsigned 32)))
+collection is initiated. This can be set with SETF.
+
+On GENCGC platforms this is the nursery size, and defaults to 5% of dynamic
+space size.
+
+Note: currently changes to this value are lost when saving core."
+  (sb!alien:extern-alien "bytes_consed_between_gcs" os-vm-size-t))
 
 (defun (setf bytes-consed-between-gcs) (val)
   (declare (type index val))
-  (setf (sb!alien:extern-alien "bytes_consed_between_gcs"
-                               (sb!alien:unsigned 32))
+  (setf (sb!alien:extern-alien "bytes_consed_between_gcs" os-vm-size-t)
         val))
 
 (declaim (inline maybe-handle-pending-gc))
@@ -374,12 +378,12 @@ collection is initiated. This can be set with SETF."
             (alloc-unboxed-start-page page-index-t)
             (alloc-large-start-page page-index-t)
             (alloc-large-unboxed-start-page page-index-t)
-            (bytes-allocated unsigned-long)
-            (gc-trigger unsigned-long)
-            (bytes-consed-between-gcs unsigned-long)
+            (bytes-allocated os-vm-size-t)
+            (gc-trigger os-vm-size-t)
+            (bytes-consed-between-gcs os-vm-size-t)
             (number-of-gcs int)
             (number-of-gcs-before-promotion int)
-            (cum-sum-bytes-allocated unsigned-long)
+            (cum-sum-bytes-allocated os-vm-size-t)
             (minimum-age-before-gc double)))
 
 #!+gencgc
@@ -416,7 +420,8 @@ collection is initiated. This can be set with SETF."
       "Number of bytes that can be allocated to GENERATION before that
 generation is considered for garbage collection. This value is meaningless for
 generation 0 (the nursery): see BYTES-CONSED-BETWEEN-GCS instead. Default is
-20Mb. Can be assigned to using SETF. Available on GENCGC platforms only.
+5% of the dynamic space size. Can be assigned to using SETF. Available on
+GENCGC platforms only.
 
 Experimental: interface subject to change."
     t)