OSSP CVS Repository

ossp - Check-in [1970]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1970
Date: 2002-Mar-07 16:01:30 (local)
2002-Mar-07 15:01:30 (UTC)
User:rse
Branch:
Comment: add Thomas' idea
Tickets:
Inspections:
Files:
ossp-pkg/ex/00TODO      1.1 -> 1.2     25 inserted, 0 deleted

ossp-pkg/ex/00TODO 1.1 -> 1.2

--- 00TODO       2002/02/14 15:56:04     1.1
+++ 00TODO       2002/03/07 15:01:30     1.2
@@ -1,4 +1,29 @@
 
+Idea: deferred exceptions:
+o ex_defer BLOCK
+o if (ex_deferred) ...
+
+to avoid having to initialize every variable in this context:
+
+char *cp1;
+char *cp2;
+char *cp3;
+ex_try {
+    ex_defer {
+        cp1 = mymalloc(...);
+        cp2 = mymalloc(...);
+        cp3 = mymalloc(...);
+    }
+}
+ex_cleanup {
+    if (cp1 != NULL)
+        free(cp1);
+    if (cp2 != NULL)
+        free(cp2);
+    if (cp3 != NULL)
+        free(cp3);
+}
+
 **** IMPROVE DOCUMENTATION ****
 
 /* BAD EXAMPLE */

CVSTrac 2.0.1