···935935936936\subsection{ss:c-simple-gc-harmony}{Simple interface}
937937938938+In general, any variable in C code that references a heap-allocated OCaml value
939939+must be known to the runtime when the GC runs, as references to any objects
940940+moved by the GC need to be updated. Modifications of mutable fields must also be
941941+tracked by the GC for correctness. Listed below are simple rules to achieve
942942+this. In some cases, the rules dictate registration of variables that may not be
943943+technically needed (eg because the referenced OCaml value is an immediate, or
944944+because the GC is guaranteed not to be invoked during the lifetime of the
945945+variable). However, trying to optimize root registration is a common source of
946946+safety bugs, so it is strongly recommended to follow the rules below in most
947947+cases. The implementation of the root registration mechanism is efficient and
948948+will not typically result in any performance penalty.
949949+938950All the macros described in this section are declared in the
939951"<caml/memory.h>" header file.
940952