[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory management question

Kalman Reti (reti@cambridge.apple.com) wrote:
: I believe your guess is correct; when there isn't enough room in the Mac heap,
: the mac invokes a growzone procedure which, in the case of MCL, gives up some
: Lisp heap to make more Mac heap.

: The only way I know of to eliminate these pauses is to have the Mac heap be big
: enough in the first place; see the arguments to save-application  in the MCL 2.0
: release notes for how to save a copy of MCL with a larger amount of space dedicated
: to the Mac heap.
(Below is a function that will also do this.)

I reponded to Kalman that it would be nice to be able to turn off the
raiding of the Lisp Heap by memory hungry toolbox functions.  This
only way (I think) of doing this is to substitute a dummy grow zone
function for the one that Lisp uses.


;;; Try to set the mac heap to "size".
(defun set-mac-heap-size (size)
    (let (p)
      (when (> size (#_freemem))
        (setq p (#_newptr 
                          :d0 size
        (if (%null-ptr-p p) nil (#_disposptr p)))))