Next Prev Up Top Contents Index

8.1 Generat strategy for reducing the image size

In many cases, the size of the image can be reduced if part of the user code or data is eliminated, for example, when this code/data is there for debugging purposes. The system, however, cannot tell which part of the code/data can be eliminated, so you have to do it yourself.

That can be done in either of two ways:

  1. You can eliminated the code/data explictly before calling deliver , by using fmakunbound , makunbound , remhash etc. The adavantage of this approach is that it does not require you to know anything about delivery. The disadvantage of this is that it has to be explicitly put in the delivery script..
  2. The image come with an action list (see entry for action-lists), "Delivery actions", which you can add actions to. This action list is executed when the delivery process starts, before any system action. For example, if *my-hash-able* contains entries that are not required in the delivered application, The you may write:
(defun clear-my-hash-table()
  (maphash #'(lambda (x y)
              (unless (required-in-the-application-p x y)
                (remhash x *my-hash-able*)))
(define-action "delivery actions" "Clear my hash table"

Using the action list has two advantages:

  1. It does not have to be part of the deliver script, so it can be written near the rest of the code that is using *my-hash-able* , which makes it easier to maintain the code.
  2. It can use the user interface of the delivery process. This is done via the function delivery-value and (setf delivery-value) .

LispWorks Delivery User Guide - 11 Dec 2001

Next Prev Up Top Contents Index