CL_UNWIND_PROTECT — Create a protected region.

C Macro

  cl_env_ptr env = ecl_process_env();
     * Code that is protected. Uncaught lisp conditions, THROW,
     * signals such as SIGSEGV and SIGBUS may cause jump to
     * this region.
     * If the exception, lisp condition or other control transfer
     * is caught, this code is executed. After this code, the
     * process will jump to the original destination of the
     * THROW, GOTO or other control statement that was interrupted.
   * We only exit here if NO nonlocal jump was interrupted.


When embedding ECL it is normally advisable to set up an unwind-protect frame to avoid the embedded lisp code to perform arbitary transfers of control. Furthermore, the unwind protect form will be used in at least in the following ocasions:

Besides this, normal mechanisms for exit, such as ext:quit, and uncaught exceptions, such as serious signals (Section 7.2.1), are best handled using unwind-protect blocks.

See also