@@ -259,23 +259,45 @@ extern struct nullNmbrStruct g_NmbrNull;
259
259
/*!
260
260
* \struct nullPntrStruct
261
261
* describing a block of memory of pntrString containing only the
262
- * null pointer. *
262
+ * null pointer. Besides the pointer it is accompanied with a header matching
263
+ * the hidden administrative values of a usual pntrString managed as a stack.
264
+ *
265
+ * The values in this administrative header are such that it is never subject to
266
+ * memory allocation or deallocation.
267
+ *
268
+ * \bug The C standard does not require a long having the same size as a
269
+ * void*. In fact there might be **no** integer type matching a pointer in size.
263
270
*/
264
271
/* Null pntrString -- NULL flags the end of a pntrString */
265
272
struct nullPntrStruct {
266
273
/*!
267
- *
274
+ * An instance of a nullPntrStruct is always standalone and never part of a
275
+ * larger pool. Indicated by the fixed value -1.
268
276
*/
269
277
long poolLoc ;
270
- /*! allocated size of the memory block containing the \a pntrString.
271
- * Note: this is the number of bytes, not elements!
278
+ /*!
279
+ * allocated size of the memory block containing the \a pntrString.
280
+ * Note: this is the number of bytes, not elements! Fixed to the size of a
281
+ * single void* instance.
272
282
*/
273
283
long allocSize ;
274
- /*! currently used size of the memory block containing the \a pntrString.
275
- * Note: this is the number of bytes, not elements!
284
+ /*!
285
+ * currently used size of the memory block containing the \a pntrString.
286
+ * Note: this is the number of bytes, not elements! Fixed to the size of a
287
+ * single pointer element.
276
288
*/
277
289
long actualSize ;
290
+ /*!
291
+ * memory for a single void* instance, set and fixed to the null pointer.
292
+ */
278
293
pntrString nullElement ; };
294
+ /*!
295
+ * \var g_PntrNull. Global instance of a memory block structured like a
296
+ * \a pntrString, but fixed in size and containing always exactly one null
297
+ * pointer element.
298
+ *
299
+ * \attention mark as const
300
+ */
279
301
extern struct nullPntrStruct g_PntrNull ;
280
302
#define NULL_PNTRSTRING &(g_PntrNull.nullElement)
281
303
#define pntrString_def (x ) pntrString *x = NULL_PNTRSTRING
0 commit comments