From 46bdb1bb29500e645e9426c07889af4a6224354e Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Mon, 7 Mar 2022 14:19:34 +1300 Subject: [PATCH] Add/update docs for Malloc(), Exit(), etc See #2223 --- Doc/Devel/cmdopt.html | 4 ++-- Doc/Devel/internals.html | 28 ++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Doc/Devel/cmdopt.html b/Doc/Devel/cmdopt.html index 5e90d2aba..10dc73170 100644 --- a/Doc/Devel/cmdopt.html +++ b/Doc/Devel/cmdopt.html @@ -60,7 +60,7 @@ and issues an error message if any unconsumed arguments are found. void Swig_check_options()
Checks all command line options to see if they have all been processed. If not, an error message is generated and -execution terminates with a call to exit(). This function is currently invoked in Source/Modules/main.cxx just before SWIG starts any processing of input files. +SWIG exits. This function is currently invoked in Source/Modules/main.cxx just before SWIG starts any processing of input files.

Utility Function

@@ -68,7 +68,7 @@ execution terminates with a call to exit(). This function is currentl void Swig_arg_error())
-A generic function that issues an error message about being unable to parse command line options. SWIG is terminated by a call to exit(). +A generic function that issues an error message about being unable to parse command line options and SWIG exits. diff --git a/Doc/Devel/internals.html b/Doc/Devel/internals.html index 0fc6623e8..d003d9dea 100644 --- a/Doc/Devel/internals.html +++ b/Doc/Devel/internals.html @@ -519,7 +519,27 @@ hash item: hashval3 [h3]

2.10 Utility functions

-[ TODO ] +

+DOH wraps some standard C library functions - these wrapped versions should +always be used in code in the SWIG tool itself (but not in generated code). +When compiling with GCC or clang, the original library function names are +marked as "poisoned" symbols so you should get an error if you accidentally +use one of the unwrapped functions. These functions are: + +

+ +abort() is also poisoned - please use Exit(EXIT_FAILURE) instead so that generated files are removed. +

+ +

+[ TODO document others ] +

3. Types and Typemaps

@@ -1194,12 +1214,12 @@ that are used after they have been deleted. This is because the DOH memory alloc grabs a chunk of memory from the C memory allocator and manages the usage internally. Stale DOH object usage can be checked for by defining DOH_DEBUG_MEMORY_POOLS in memory.c. If an attempt to use an object is made after the reference count is -zero, an assertion is triggered instead of quietly re-using the stale object... +zero, a fatal error is triggered instead of quietly re-using the stale object:

-swig: DOH/memory.c:91: DohCheck: Assertion `!DOH_object_already_deleted' failed.
+Fatal internal error: Attempt to delete a non-DOH object.
 
@@ -1209,7 +1229,7 @@ only recommended for diagnosing memory corruption problems.


-Copyright (C) 1999-2010 SWIG Development Team. +Copyright (C) 1999-2022 SWIG Development Team.