8.2.1 Using a Single SICStus Run-Time

When building an application with spld, by default only one SICStus run-time can be loaded in the process. This is similar to the case in SICStus versions prior to 3.9. For most applications built with spld, the changes necessary to support multiple SICStus run-times should be invisible, and old code should only need to be rebuilt with spld.

In order to maintain backward compatibility, the global dispatch vector is automatically set up implicitly by SP_initialize() and explicitly by SP_setup_dispatch(). Other SICStus API functions will not set up the dispatch vector, and will therefore lead to memory access errors if called before SP_initialize(). Currently, hook functions such as SP_set_memalloc_hooks() also set up the dispatch vector to allow them to be called before SP_initialize(). However, only SP_initialize() and SP_setup_dispatch() are guaranteed to set up the dispatch vector. The hook installation functions may change to use a different mechanism in the future. The SICStus API functions that perform automatic setup of the dispatch vector are marked with SPEXPFLAG_PREINIT in sicstus.h.


Send feedback on this subject.