* Genesis to check that spaces don't overlap.
* At startup make sure --dynamic-space-size doesn't overflow, or run
into any space possibly on top of dynamic space. (GENCGC only.)
"*CONTROL-STACK-START*" "*CONTROL-STACK-END*"
"CONTROL-STACK-POINTER-VALID-P"
"DYNAMIC-SPACE-START" "DYNAMIC-SPACE-END"
+ #!+gencgc "MAX-DYNAMIC-SPACE-END"
#!+c-stack-is-control-stack "ALTERNATE-SIGNAL-STACK-START"
#!-gencgc "DYNAMIC-0-SPACE-START"
#!-gencgc "DYNAMIC-0-SPACE-END"
(min #x1fffffffffffff most-positive-fixnum))
(def!constant most-negative-exactly-double-float-fixnum
(max #x-1fffffffffffff most-negative-fixnum))
+
+;;;; Point where continuous area starting at dynamic-space-start bumps into
+;;;; next space.
+#!+gencgc
+(def!constant max-dynamic-space-end
+ (let ((stop (1- (ash 1 n-word-bits)))
+ (start dynamic-space-start))
+ (dolist (other-start (list read-only-space-start static-space-start linkage-table-space-start))
+ (when (< start other-start)
+ (setf stop (min stop other-start))))
+ stop))
(do-cold-fixup code-object offset value kind)
code-object))
\f
+;;;; sanity checking space layouts
+
+(defun check-spaces ()
+ ;;; Co-opt type machinery to check for intersections...
+ (let (types)
+ (flet ((check (start end space)
+ (unless (< start end)
+ (error "Bogus space: ~A" space))
+ (let ((type (specifier-type `(integer ,start ,end))))
+ (dolist (other types)
+ (unless (eq *empty-type* (type-intersection (cdr other) type))
+ (error "Space overlap: ~A with ~A" space (car other))))
+ (push (cons space type) types))))
+ (check sb!vm:read-only-space-start sb!vm:read-only-space-end :read-only)
+ (check sb!vm:static-space-start sb!vm:static-space-end :static)
+ #!+gencgc
+ (check sb!vm:dynamic-space-start sb!vm:dynamic-space-end :dynamic)
+ #!-gencgc
+ (progn
+ (check sb!vm:dynamic-0-space-start sb!vm:dynamic-0-space-end :dynamic-0)
+ (check sb!vm:dynamic-1-space-start sb!vm:dynamic-1-space-end :dynamic-1))
+ #!+linkage-table
+ (check sb!vm:linkage-table-space-start sb!vm:linkage-table-space-end :linkage-table))))
+\f
;;;; emitting C header file
(defun tailwise-equal (string tail)
(do-all-symbols (sym)
(remprop sym 'cold-intern-info))
+ (check-spaces)
+
(let* ((*foreign-symbol-placeholder-value* (if core-file-name nil 0))
(*load-time-value-counter* 0)
(*cold-fdefn-objects* (make-hash-table :test 'equal))
dynamic_space_size = strtol(argv[argi++], 0, 0) << 20;
if (errno)
lose("argument to --dynamic-space-size is not a number");
+# ifdef MAX_DYNAMIC_SPACE_END
+ if (!((DYNAMIC_SPACE_START < DYNAMIC_SPACE_START+dynamic_space_size) &&
+ (DYNAMIC_SPACE_START+dynamic_space_size <= MAX_DYNAMIC_SPACE_END)))
+ lose("specified --dynamic-space-size too large");
+# endif
} else if (0 == strcmp(arg, "--control-stack-size")) {
++argi;
if (argi >= argc)
errno = 0;
thread_control_stack_size = strtol(argv[argi++], 0, 0) << 20;
if (errno)
- lose("argument to --dynamic-space-size is not a number");
+ lose("argument to --control-stack-size is not a number");
} else if (0 == strcmp(arg, "--debug-environment")) {
int n = 0;
printf("; Commandline arguments:\n");
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.24.2"
+"1.0.24.3"