Ignore:
Timestamp:
May 23, 2011, 12:25:45 PM (8 years ago)
Author:
gb
Message:

Define and export the functions ALLOW-HEAP-ALLOCATION and
HEAP-ALLOCATION-ALLOWED-P and the condition type ALLOCATION-DISABLED.

(ALLOW-HEAP-ALLOCATION arg) : when ARG is NIL, causes any subsequent
attempts to heap-allocate lisp memory to signal (as if by CERROR)
an ALLOCATION-DISABLED condition. (Allocaton is enabled globally at
the point where the error is signaled.) Continuing from the CERROR
restarts the allocation attempt.

This is intended to help verify that code that's not expected to
cons doesn't do so.

(This is only implemented on the ARM at the moment, but the intent
is that it be supported on all platforms.)

Note that calling (ALLOW-HEAP-ALLOCATION NIL) in the REPL CERRORs
immediately, since the REPL will cons to create the new value of CL:/.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/arch.lisp

    r13792 r14807  
    6868(defconstant error-cant-call 17)        ; Attempt to funcall something that is not a symbol or function.
    6969(defconstant error-allocate-list 18)
     70(defconstant error-allocation-disabled 19)
    7071
    7172(eval-when (:compile-toplevel :load-toplevel :execute)
     
    356357(defconstant gc-trap-function-get-gc-notification-threshold 20)
    357358(defconstant gc-trap-function-set-gc-notification-threshold 21)
    358 
     359(defconstant gc-trap-function-allocation-control 22)
    359360(defconstant gc-trap-function-egc-control 32)
    360361(defconstant gc-trap-function-configure-egc 64)
Note: See TracChangeset for help on using the changeset viewer.