FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

aclmalloc

Arguments: size &key restart-relocation

Uses the C aclmalloc() function to allocate a data block that is persistent across dumplisp/restarts. The location in the restarted image is guaranteed to be the same as in the dumped image (if Lisp is unable to map it to that location, Lisp startup will fail). This means that addresses in locations allocated by aclmalloc will be valid.

The block is guaranteed to be aligned to at least an 8-byte boundary. The returned value is an integer whose magnitude is the machine address of the allocated block. (0 is returned if aclmalloc is unable to get the requested space.)

The size argument specifies the number of bytes to allocate.

The restart-relocation keyword argument has no effect in Allegro CL. It is intended for possible future enhancements.

aclfree frees space allocated by aclmalloc.

Note on various Allegro CL malloc and free functions

The space allocated by excl:malloc and its C counterpart malloc() (described here collectively as "malloc") is different than the space allocated by excl:aclmalloc and the C aclmalloc() (described collectively as "aclmalloc"). Malloc allocates in space defined and maintained by the system, in whatever manner the system defines. Some operating systems allow the linking in of alternate versions of malloc() and its cohorts (usually including free(), calloc(), realloc(), and others), giving some flexibility in debugging malloc bugs (but of course this need arises much less often in Lisp programming). The aclmalloc functionalities are part of the Allegro CL library and allocate from space usually known as Aclmalloc heap space. aclmalloc is useful for allocating objects which should survive the rebirth of a dumped lisp.

The free and aclfree functionalities must always match objects to free with the mallocs of the same kind; i.e. one should never free an aclmalloc'd object, nor should one call an aclfree function on an object created with malloc. Note that one can mix aclmalloc/aclfree with aclmalloc-aligned/aclfree-aligned, but only after proper conversions are done; see ff:address-to-aligned and ff:aligned-to-address.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version