Update relocations per August psABI docs.
[deliverable/binutils-gdb.git] / include / hashtab.h
index 12f830ca5ec5286960057f9b889bf1cb25bf5f6c..a577c5e2afe644c5d60763dbc2a2d75b4bdb6d65 100644 (file)
@@ -80,7 +80,7 @@ struct htab
   htab_del del_f;
 
   /* Table itself.  */
-  void **entries;
+  PTR *entries;
 
   /* Current size (in entries) of the hash table */
   size_t size;
@@ -98,6 +98,10 @@ struct htab
   /* The following member is used for debugging.  Its value is number
      of collisions fixed for time of work with the hash table. */
   unsigned int collisions;
+
+  /* This is non-zero if we are allowed to return NULL for function calls
+     that allocate memory.  */
+  int return_allocation_failure;
 };
 
 typedef struct htab *htab_t;
@@ -109,15 +113,21 @@ enum insert_option {NO_INSERT, INSERT};
 
 extern htab_t  htab_create     PARAMS ((size_t, htab_hash,
                                         htab_eq, htab_del));
+
+/* This function is like htab_create, but may return NULL if memory
+   allocation fails, and also signals that htab_find_slot_with_hash and
+   htab_find_slot are allowed to return NULL when inserting.  */
+extern htab_t  htab_try_create PARAMS ((size_t, htab_hash,
+                                        htab_eq, htab_del));
 extern void    htab_delete     PARAMS ((htab_t));
 extern void    htab_empty      PARAMS ((htab_t));
 
-extern void    *htab_find      PARAMS ((htab_t, const void *));
-extern void   **htab_find_slot PARAMS ((htab_t, const void *,
+extern PTR     htab_find       PARAMS ((htab_t, const void *));
+extern PTR     *htab_find_slot PARAMS ((htab_t, const void *,
                                         enum insert_option));
-extern void    *htab_find_with_hash      PARAMS ((htab_t, const void *,
+extern PTR     htab_find_with_hash       PARAMS ((htab_t, const void *,
                                                   hashval_t));
-extern void   **htab_find_slot_with_hash  PARAMS ((htab_t, const void *,
+extern PTR     *htab_find_slot_with_hash  PARAMS ((htab_t, const void *,
                                                   hashval_t,
                                                   enum insert_option));
 extern void    htab_clear_slot PARAMS ((htab_t, void **));
This page took 0.02387 seconds and 4 git commands to generate.