12.4.12 Discarding Data
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • The Foreign Include File
          • Discarding Data
            • PL_open_foreign_frame()
            • PL_close_foreign_frame()
            • PL_discard_foreign_frame()
            • PL_rewind_foreign_frame()
    • Packages
Availability:C-language interface function
fid_t PL_open_foreign_frame()

Create a foreign frame, holding a mark that allows the system to undo bindings and destroy data created after it, as well as providing the environment for creating term references. This function is called by the kernel before calling a foreign predicate. Returns (fid_t)0 on failure. Failure is either lack of space on the stacks, in which case a resource exception is scheduled or atom-gc being in progress in the current thread, in which case no exception is scheduled. The latter is an exceptional case that prevents doing a callback on Prolog from blob release handlers.224Such a callback would deadlock if the callback creates new atoms or requires stack shifts or garbage collection.