51
51
/*E*/ extern long db2 ;
52
52
/*!
53
53
* \var db3
54
- * \brief monitors the de/allocations of nmbrString and pntrString outside of
55
- * temporary arrays.
54
+ * \brief monitors the de/allocations of nmbrString and \ref pntrString outside
55
+ * of temporary arrays.
56
56
*
57
57
* The number of bytes held in blocks dedicated to global data. There exist
58
58
* also temporary stacks, but they are not considered here. Useful to see
@@ -123,6 +123,12 @@ typedef long nmbrString; /* String of numbers */
123
123
* tail of an array from a certain element on, an array terminates with a
124
124
* null pointer. This type of usage forbids null pointer as ordinary elements,
125
125
* and the terminal null pointer is not part of the data in the array.
126
+ * \n
127
+ * The length of a pntrString array is implicitely given by a terminal NULL
128
+ * pointer. If this array is held in a \ref block, its size can also be
129
+ * determined from its header's administrative data. Both values must be kept
130
+ * synchronized. In early phases of memory allocation, when data wasn't
131
+ * assigned yet, this need not hold.
126
132
*
127
133
* To summarize the usages of this type:
128
134
* - If you want to resize the array/stack you need a pointer to element 0.
@@ -325,9 +331,11 @@ void *poolFixedMalloc(long size /* bytes */);
325
331
* \ref block is properly initialized. Exits program on out of memory
326
332
* condition.
327
333
* \param[in] size (in bytes) of the block, not including the block header.
328
- * \return a \ref block with enough capacity for \p size bytes of data. The
329
- * data space is filled with random contents, but in the block header its
330
- * \p size is noted.´ Exit on out-of-memory
334
+ * \return a \ref block with enough capacity for \p size bytes of data.
335
+ * \post
336
+ * - The \ref block "block's" header denotes \p size bytes are occupied, but
337
+ * they yet contain random data.
338
+ * - Exit on out-of-memory.
331
339
*/
332
340
void * poolMalloc (long size /* bytes */ );
333
341
/*!
@@ -339,7 +347,7 @@ void *poolMalloc(long size /* bytes */);
339
347
* added.
340
348
* \param[in] ptr pointer to a \ref block.
341
349
* \pre
342
- * - \p ptr was previously dynamically allocated.
350
+ * - \p ptr refers to dynamically allocated memory on the heap .
343
351
* - all memory pointed to by \p ptr is considered free. This holds even if it
344
352
* it is kept in \ref memUsedPool.
345
353
* \post
0 commit comments