X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/e8d70b1b4abe17f1425aa7b8d4e582cd02372766..6afec9101d5ea87e3df4bda2239ffd05f8154fa6:/doc/runtime.tex diff --git a/doc/runtime.tex b/doc/runtime.tex index a67d994..83acd31 100644 --- a/doc/runtime.tex +++ b/doc/runtime.tex @@ -43,7 +43,7 @@ calling functions which make use of keyword arguments; see The header file defines two simple structure types, and a function type which will be described later. -\begin{describe}{type}[struct kwval] +\begin{describe}{ty}[struct kwval] {struct kwval \{ \\ \ind const char *kw; \\ const void *val; \-\\ @@ -56,7 +56,7 @@ will be described later. the actual argument type.) \end{describe} -\begin{describe}{type}[struct kwtab] +\begin{describe}{ty}[struct kwtab] {struct kwtab \{ \\ \ind const struct kwval *v; \\ size_t n; \-\\ @@ -528,7 +528,7 @@ call @|kw_unknown|. message to the standard error stream and calls \man{abort}{3}. \end{describe} -\begin{describe}{type}[kw_unkhookfn] +\begin{describe}{ty}[kw_unkhookfn] {typedef void kw_unkhookfn(const char *@, const char *@);} The @|kw_unkhookfn| type is the type of unknown-keyword handler functions. @@ -615,6 +615,13 @@ instances and classes inherit from the standard @|SodObject| root object. While the translator can (at some effort) support alternative roots, they will require different run-time support machinery. +\begin{describe}{feat}{SOD_RECKLESS} + Some of Sod's macros include runtime checking by default. This checking + can be disabled if you value performance more than early diagnosis of + problems. Define @|SOD_RECKLESS| to a nonzero value before including + @|| to inhibit the runtime checking. +\end{describe} + \subsection{Layout utilities} \label{sec:runtime.object.layout} @@ -815,7 +822,12 @@ The following macro constructs an instance with automatic storage duration. The instance has automatic storage duration: pointers to it will become invalid when control exits the scope of the declaration. If necessary, the instance should be torn down before this happens, using the - \descref{fun}{sod_teardown}[function]. + \descref{fun}{sod_teardown}[function]. It may be appropriate to @|assert| + that the object is ready for deallocation at this time. + + By default, this macro will abort the program if the size allocated for the + instance doesn't match the size required by the class object; set + \descref{feat}{SOD_RECKLESS} to inhibit this check. \end{describe} \subsubsection{Dynamic allocation}