1 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
12 ;;; the number of bits at the low end of a pointer used for type
14 (def!constant n-lowtag-bits
15 (integer-length (1- (/ (* 2 n-word-bits) n-byte-bits))))
16 ;;; a mask to extract the low tag bits from a pointer
17 (def!constant lowtag-mask (1- (ash 1 n-lowtag-bits)))
18 ;;; the exclusive upper bound on the value of the low tag bits from a
20 (def!constant lowtag-limit (ash 1 n-lowtag-bits))
21 ;;; the number of tag bits used for a fixnum
22 (def!constant n-fixnum-tag-bits (1- n-lowtag-bits))
23 ;;; the fixnum tag mask
24 (def!constant fixnum-tag-mask (1- (ash 1 n-fixnum-tag-bits)))
25 ;;; the bit width of positive fixnums
26 (def!constant n-positive-fixnum-bits (- n-word-bits n-fixnum-tag-bits 1))
28 ;;; the number of bits to shift between word addresses and byte addresses
29 (def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits))))
31 ;;; the number of bytes in a word
32 (def!constant n-word-bytes (/ n-word-bits n-byte-bits))
34 ;;; the number of bits used in the header word of a data block to store
36 (def!constant n-widetag-bits 8)
37 ;;; a mask to extract the type from a data block header word
38 (def!constant widetag-mask (1- (ash 1 n-widetag-bits)))
40 (def!constant sb!xc:most-positive-fixnum
41 (1- (ash 1 (- n-word-bits n-lowtag-bits)))
43 "the fixnum closest in value to positive infinity")
44 (def!constant sb!xc:most-negative-fixnum
45 (ash -1 (- n-word-bits n-lowtag-bits))
47 "the fixnum closest in value to negative infinity")
49 (def!constant most-positive-exactly-single-float-fixnum
50 (min #xffffff sb!xc:most-positive-fixnum))
51 (def!constant most-negative-exactly-single-float-fixnum
52 (max #x-ffffff sb!xc:most-negative-fixnum))
53 (def!constant most-positive-exactly-double-float-fixnum
54 (min #x1fffffffffffff sb!xc:most-positive-fixnum))
55 (def!constant most-negative-exactly-double-float-fixnum
56 (max #x-1fffffffffffff sb!xc:most-negative-fixnum))
58 ;;;; Point where continuous area starting at dynamic-space-start bumps into
61 (def!constant max-dynamic-space-end
62 (let ((stop (1- (ash 1 n-word-bits)))
63 (start dynamic-space-start))
64 (dolist (other-start (list read-only-space-start static-space-start linkage-table-space-start))
65 (when (< start other-start)
66 (setf stop (min stop other-start))))