x86-64: Use pr22393-3a.so and pr22393-3a-now.so
[deliverable/binutils-gdb.git] / gdb / gdb_obstack.h
index 3010cb6b10c1e4d6a2ea4ce5414e087ba0e2ab5e..12a90c38fd51dc6d5710fdd954beff94981b1497 100644 (file)
@@ -1,6 +1,6 @@
 /* Obstack wrapper for GDB.
 
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -63,4 +63,19 @@ extern char *obconcat (struct obstack *obstackp, ...) ATTRIBUTE_SENTINEL;
 
 extern char *obstack_strdup (struct obstack *obstackp, const char *string);
 
+/* An obstack that frees itself on scope exit.  */
+struct auto_obstack : obstack
+{
+  auto_obstack ()
+  { obstack_init (this); }
+
+  ~auto_obstack ()
+  { obstack_free (this, NULL); }
+
+  /* Free all memory in the obstack but leave it valid for further
+     allocation.  */
+  void clear ()
+  { obstack_free (this, obstack_base (this)); }
+};
+
 #endif
This page took 0.024347 seconds and 4 git commands to generate.