]> gcc.gnu.org Git - gcc.git/commitdiff
hashtab.h (struct htab): Add member return_allocation_failure.
authorHans-Peter Nilsson <hp@bitrange.com>
Sat, 4 Nov 2000 07:35:33 +0000 (07:35 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Sat, 4 Nov 2000 07:35:33 +0000 (07:35 +0000)
* hashtab.h (struct htab): Add member return_allocation_failure.
(htab_try_create): New prototype.  Mention which functions may
return NULL when this is used.

From-SVN: r37246

include/ChangeLog
include/hashtab.h

index 038df37250a498fab223be357b7abfcdb8a3625b..73b89965f000e188a0f18102fb95d4fd2c1e706e 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-04  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * hashtab.h (struct htab): Add member return_allocation_failure.
+       (htab_try_create): New prototype.  Mention which functions may
+       return NULL when this is used.
+
 2000-11-03  Hans-Peter Nilsson  <hp@bitrange.com>
 
        * hashtab.h: Change void * to PTR where necessary.
index c110ac5d1d6f1d9bdbf11626ebf2189e3e3167b4..a577c5e2afe644c5d60763dbc2a2d75b4bdb6d65 100644 (file)
@@ -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,6 +113,12 @@ 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));
 
This page took 0.067998 seconds and 5 git commands to generate.