Skip to content

Commit ff8f9d1

Browse files
committed
improve doc of poolMalloc
1 parent 023eda4 commit ff8f9d1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/mmdata.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,18 @@ typedef long nmbrString; /* String of numbers */
115115
* \brief an array (maybe of size 1) of untyped pointers (void*)
116116
*
117117
* In general this array is organized like a stack: the number of elements in
118-
* the pntrString grows and shrinks during program flow, values are pushed and
119-
* popped at the end. Such a stack is embedded in a \ref block that contains
120-
* administrative information about the stack. The stack begins with
118+
* the pntrString array grows and shrinks during program flow, values are
119+
* pushed and popped at the end. Such a stack is embedded in a \ref block that
120+
* contains administrative information about the stack. The stack begins with
121121
* element 0, and the administrative information is accessed through negative
122122
* indices, but need reinterpretation then. To allow iterating through the
123-
* tail of the array from a certain element on, the array terminates with a
123+
* tail of an array from a certain element on, an array terminates with a
124124
* null pointer. This type of usage forbids null pointer as ordinary elements,
125125
* and the terminal null pointer is not part of the data in the array.
126126
*
127127
* To summarize the usages of this type:
128128
* - If you want to resize the array/stack you need a pointer to element 0.
129-
* - You can iterate from an arbitrary pointer to the end.
129+
* - You can iterate from an arbitrary element to the end.
130130
* - Sometimes pntrString denotes an isolated element, not embedded in a
131131
* greater array.
132132
*
@@ -161,7 +161,7 @@ typedef nmbrString temp_nmbrString;
161161
*
162162
* These elements are pushed onto and popped off a \ref stack
163163
* "stack of temporary data". All pointer of this type should ONLY refer to
164-
* adynamically llocated memory on the heap. Special commands support
164+
* dynamically allocated memory on the heap. Special commands support
165165
* dependency tracking and free all pointers on and after a particular one in
166166
* such a stack.
167167
*/
@@ -324,10 +324,10 @@ void *poolFixedMalloc(long size /* bytes */);
324324
* the given size is allocated from the system. In any case, the header of the
325325
* \ref block is properly initialized. Exits program on out of memory
326326
* condition.
327-
* \param[in] size (in bytes) of the block, not including the block header, but
328-
* including space for a terminal NULL.
329-
* \return a free and initialized block of memory with at least the requested
330-
* user space. Exit on out-of-memory
327+
* \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
331331
*/
332332
void *poolMalloc(long size /* bytes */);
333333
/*!
@@ -339,7 +339,7 @@ void *poolMalloc(long size /* bytes */);
339339
* added.
340340
* \param[in] ptr pointer to a \ref block.
341341
* \pre
342-
* - \p ptr was previously allocated.
342+
* - \p ptr was previously dynamically allocated.
343343
* - all memory pointed to by \p ptr is considered free. This holds even if it
344344
* it is kept in \ref memUsedPool.
345345
* \post

0 commit comments

Comments
 (0)