gdb/
[deliverable/binutils-gdb.git] / gdb / utils.c
index eb870ac92efaecf518641c0b726db2e41eb58cc2..fdebbdc3ea5d7fd46825b26e02b58c3ab406fe2e 100644 (file)
@@ -53,6 +53,7 @@
 #include "annotate.h"
 #include "filenames.h"
 #include "symfile.h"
+#include "gdb_obstack.h"
 
 #include "inferior.h"          /* for signed_pointer_to_address */
 
@@ -3124,3 +3125,26 @@ align_down (ULONGEST v, int n)
   gdb_assert (n && (n & (n-1)) == 0);
   return (v & -n);
 }
+
+/* Allocation function for the libiberty hash table which uses an
+   obstack.  The obstack is passed as DATA.  */
+
+void *
+hashtab_obstack_allocate (void *data, size_t size, size_t count)
+{
+  unsigned int total = size * count;
+  void *ptr = obstack_alloc ((struct obstack *) data, total);
+  memset (ptr, 0, total);
+  return ptr;
+}
+
+/* Trivial deallocation function for the libiberty splay tree and hash
+   table - don't deallocate anything.  Rely on later deletion of the
+   obstack.  DATA will be the obstack, although it is not needed
+   here.  */
+
+void
+dummy_obstack_deallocate (void *object, void *data)
+{
+  return;
+}
This page took 0.026035 seconds and 4 git commands to generate.