pointer-storage-type

Function

Package: system

Arguments: object

Returns a keyword denoting where object is stored. The four possible return values are

  1. :immediate, which means the object is not referenced with a pointer (fixnums, e.g.)
  2. :static, which means the object is stored in an area which is not garbage collected.
  3. :tenured, which means the object is stored in oldspace (also called tenured space).
  4. :new, which means the object is stored in newspace but will, if it survives, eventually be tenured.
  5. :pan: which means that the object is stored in newspace and will never be tenured. (The name comes from Peter Pan, who never grew old.) See the note just below.

Note on :pan objects: Only system-ctreated objects can have storage type :pan but sometimes these objects are created as a consequnce of user action. The key vector of a weak-keys hashtable is typically a :pan object, though this can be controlled. See cl:make-hash-table in implementation.htm.

See gc.htm for a discussion of where Lisp objects are stored.

;; A 1-d static array has storage type :STATIC
;; (2-d and higher dimension
;; static arrays have headers that are Lisp objects so they will have
;; storage type :NEW or :TENURED, but their data vectors
;; (avaiable via INSPECT) 
;; will have storage type :STATIC):
USER(24): (sys:pointer-storage-type (make-array 3 :allocation :static
:element-type 'fixnum :initial-element 2))
:static
;; Fixnums are immediates:
USER(25): (sys:pointer-storage-type 22)
:immediate
;; Most Lisp objects start in new space:
USER(26): (setq a (cons 1 2))
(1 . 2)
USER(27): (sys:pointer-storage-type a)
:new
;; And after surviving several scavenges, move to oldspace:
USER(28): (gc) (gc) (gc) (gc) (gc)
USER(29): (sys:pointer-storage-type a)
:tenured

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.