45
45
/*E*/ extern long db1 ;
46
46
/*!
47
47
* \var long db2
48
- * Bytes held in \ref blocks managed in \ref tempAllocStack
48
+ * Bytes held in \ref block " blocks" managed in \ref tempAllocStack
49
49
* "temporary pointer stacks".
50
50
*/
51
51
/*E*/ extern long db2 ;
@@ -526,6 +526,25 @@ extern struct nullPntrStruct g_PntrNull;
526
526
* \post The variable is initialized.
527
527
*/
528
528
#define pntrString_def (x ) pntrString *x = NULL_PNTRSTRING
529
+ /*!
530
+ * \def free_pntrString
531
+ * \param[in,out] x variable name
532
+ * Assigns \ref NULL_PNTRSTRING to a variable \ref pntrString \p x. Frees all
533
+ * \ref pntrTempAllocStack, beginning with index
534
+ * \ref g_pntrStartTempAllocStack. See \ref pntrLet.
535
+ * \pre
536
+ * - the \ref block assigned to \p x does not contain any valuable data.
537
+ * - all \ref pntrString elements freed in \ref pntrTempAllocStack can be
538
+ * discarded without losing relevant references.
539
+ * \post
540
+ * - \p x is assigned NULL_PNTRSTRING.
541
+ * - The stack pointer of \ref pntrTempAllocStack is reset to
542
+ * \ref g_pntrStartTempAllocStack and all referenced
543
+ * \ref block "blocks" on and beyond that are returned to the
544
+ * \ref memFreePool.
545
+ * - updates \ref db3 and \ref poolTotalFree.
546
+ * - Exit on out-of-memory
547
+ */
529
548
#define free_pntrString (x ) pntrLet(&x, NULL_PNTRSTRING)
530
549
531
550
@@ -692,7 +711,7 @@ long compressedProofSize(const nmbrString *proof, long statemNum);
692
711
*/
693
712
extern long g_pntrTempAllocStackTop ; /* Top of stack for pntrTempAlloc function */
694
713
/*!
695
- * \var long g_pntrTempAllocStackStart
714
+ * \var long g_pntrStartTempAllocStack
696
715
*
697
716
* Index of the first entry of the \ref stack "stack" \ref pntrTempAllocStack
698
717
* eligible for deallocation on the next call to \ref pntrTempAlloc. Entries
@@ -732,7 +751,7 @@ temp_pntrString *pntrMakeTempAlloc(pntrString *s);
732
751
* \n
733
752
* It is assumed that the value persisted in \p target is in fact computed from
734
753
* temporary operands in \ref pntrTempAllocStack. All blocks starting with
735
- * the element at \ref g_pntrTempAllocStackStart are returned to the
754
+ * the element at \ref g_pntrStartTempAllocStack are returned to the
736
755
* \ref memFreePool.
737
756
* \attention freed \ref block "blocks" contain \ref pntrString instances.
738
757
* See \ref pntrTempAllocStack to learn how this free process can be
@@ -754,7 +773,7 @@ temp_pntrString *pntrMakeTempAlloc(pntrString *s);
754
773
* - due to a possible reallocation the pointer \p target points to may
755
774
* change.
756
775
* - The stack pointer of \ref pntrTempAllocStack is reset to
757
- * \ref g_pntrTempAllocStackStart and all referenced
776
+ * \ref g_pntrStartTempAllocStack and all referenced
758
777
* \ref block "blocks" on and beyond that are returned to the
759
778
* \ref memFreePool.
760
779
* - updates \ref db3 and \ref poolTotalFree.
0 commit comments