next up previous
Next: Calls based on Up: The Foreign Include Previous: Calling Prolog from

Discarding Data

The Prolog data created during setting up the call and calling Prolog can in most cases be discarded right after the call. See figure gif for an example.

void
PL_mark( bktrk_buf)
  Mark the global and trail stacks in bktrk_buf.
void
PL_bktrk( bktrk_buf)
  Undo all changes in the runtime stacks since a snapshot has been made in buffer using PL_mark(). Changes to the heap are not affected.

It is not necessary to call PL_bktrk() for each PL_mark(). The user should ensure that PL_bktrk() is never called with a buffer that is created after a buffer to which PL_bktrk() has been called. Thus PL_mark(b1) ... PL_mark(b2) ... PL_bktrk(b1) is valid, but it is not allowed to call PL_bktrk(b2) after this sequence.

  
Figure: Calling Prolog



Passani Luca
Tue Nov 14 08:58:33 MET 1995