All Manuals > LispWorks User Guide and Reference Manual > 5 The Trace Facility > 5.2 Tracing options

NextPrevUpTopContentsIndex

5.2.8 Storing the memory allocation made during a function call

:allocation

Trace keyword

:allocation form

If form is non-nil, this prints the memory allocation, in bytes, made during a function call. The symbol that form evaluates to is used to accumulate the amount of memory allocated between entering and exiting the traced function.

Note that this symbol continues to be used as an accumulator on subsequent calls to the traced function; the value is compounded, rather than over-written.

Consider the example below:

  1. For the fac function, set the value of :allocation to $$fac-alloc .
  2. In the listener, call fac , and then evaluate $$fac-alloc .
CL-USER 152 > $$fac-alloc
744

LispWorks User Guide and Reference Manual - 21 Dec 2011

NextPrevUpTopContentsIndex