@@ -259,8 +259,8 @@ typedef vstring temp_vstring;
259
259
* directly to avoid buildup of temporary strings.
260
260
*
261
261
* \pre
262
- * \ref g_startTempAllocStack is the index in \ref tempAllocStack from which
263
- * on enties are freed .
262
+ * All references freed in \ref tempAllocStack can be safely discarded
263
+ * without risking a memory leak .
264
264
* \post
265
265
* - Entries in \ref tempAllocStack from index \ref g_startTempAllocStack on
266
266
* are freed. The top of stack \ref g_tempAllocStackTop is back to
@@ -283,31 +283,28 @@ void freeTempAlloc(void);
283
283
* again. Every entry on and beyond \ref g_startTempAllocStack is considered
284
284
* to be consumed and subject to deallocation.
285
285
*
286
- * This deallocation procedure is embedded in this operation, since frequently
287
- * the final string was composed of some fragments, that now can be disposed
288
- * of. In fact, this function must ALWAYS be called to assign to a vstring in
289
- * order for the memory cleanup routines, etc. to work properly. A new vstring
286
+ * This deallocation procedure is embedded in this operation, since often the
287
+ * final string is composed of some fragments, that now can be disposed of. In
288
+ * fact, this function must ALWAYS be called to assign to a vstring in order
289
+ * for the memory cleanup routines, etc. to work properly. A new vstring
290
290
* should be initialized to "" (the empty string), and the \ref vstring_def
291
291
* macro handles creation of such variables.
292
292
*
293
293
* Possible failures: Out of memory condition.
294
294
*
295
- * \param[out] target (not null) address of a \ref vstring receiving a copy of
295
+ * \param[in, out] target (not null) address of a \ref vstring receiving a copy of
296
296
* the source string. Its current value, if not empty, must never point to a
297
- * true portion of another \ref vstring. It must not coincide with any of
298
- * the temporary strings in \ref tempAllocStack, from index
299
- * \ref g_startTempAllocStack on. You can assign to an entry with index
300
- * below this value, though.
297
+ * true tail of another \ref vstring. You must not assign to any of the
298
+ * temporary strings in \ref tempAllocStack.
301
299
* \param[in] source (not null) NUL terminated string to be copied from.
302
300
*
303
301
* \pre
304
302
* - \ref g_startTempAllocStack contains the starting index of entries in
305
303
* \ref tempAllocStack, that is going to be deallocated.
306
- * - both parameters are not null and point to NUL terminated strings.
307
304
* - The destination of this function must either be empty, or uniquely point
308
305
* to a \ref vstring, but not any of the \ref temp_vstring;
309
306
* - The destination need not provide enough space for the source. If
310
- * necessary, it is reallocated to point to a larger chunk of memory ;
307
+ * necessary, it is reallocated;
311
308
* \post
312
309
* - Entries in \ref tempAllocStack from \ref g_startTempAllocStack (on entry
313
310
* to the function) are deallocated;
@@ -316,6 +313,7 @@ void freeTempAlloc(void);
316
313
* - If the assigned value is the empty string, but the destination not, it is
317
314
* freed and assigned to a constant "";
318
315
* - \ref db is updated.
316
+ * \bug In an out-of-memory situation the program is not exited
319
317
*/
320
318
void let (vstring * target , const char * source );
321
319
0 commit comments