All Manuals > LispWorks User Guide and Reference Manual > 49 The SYSTEM Package

NextPrevUpTopContentsIndex

make-object-permanent

Function
Summary

Mobile GC only: Make a large object permanent.

Package

system

Signature

make-object-permanent object => did-it-p

Arguments

object

An object that is allocated in its own segment.

Values

did-it-p

A boolean.

Description

The function make-object-permanent makes object permanent (if possible), which means that GC will never scan or free it (but will still follow pointers from it). That reduces the amount of work for the GC.

make-object-permanent can only make object permanent if it is allocated in its own segment, so it must be a large object (> 1 MB).

make-object-permanent returns true if object was made permanent (or is already permanent) and false otherwise.

Notes

An object that has been made permanent will never be freed by the GC, so you must use release-object-and-nullify to free it.

After the object is made permanent, the segment in which the object resides is reported by (room t) to be in generation 3.

make-object-permanent does not work (it just returns false) on an array that is displaced to a vector that is allocated on its own segment. To work it must be called on the vector itself.

Large vectors that do not contain pointers (that is every vector except simple-vector) are not scanned by the GC, so making them permanent does not give a significant gain. Thus make-object-permanent is really useful only for simple-vector objects.

If you make a new large simple-vector objects and want to make them permanent immediately, it is better to use make-permanent-simple-vector, because make-object-permanent causes the next GC to take more time, while make-permanent-simple-vector does not (unless supplied an initial-element which is not immediate or permanent).

See also

make-permanent-simple-vector
release-object-and-nullify
allocated-in-its-own-segment-p
Special considerations for the Mobile GC


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex