diff options
author | hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-04 07:35:33 +0000 |
---|---|---|
committer | hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-04 07:35:33 +0000 |
commit | 9e3753e9d25659d282b69297c1de02ac5997135e (patch) | |
tree | 7b07fca6d38494e0493164e173efc3013e1a383a /include/hashtab.h | |
parent | c2302820134379e1e4afb982a351e3d7efa95d3f (diff) | |
download | gcc-9e3753e9d25659d282b69297c1de02ac5997135e.tar.gz |
* hashtab.h (struct htab): Add member return_allocation_failure.
(htab_try_create): New prototype. Mention which functions may
return NULL when this is used.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37246 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'include/hashtab.h')
-rw-r--r-- | include/hashtab.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/hashtab.h b/include/hashtab.h index c110ac5d1d6..a577c5e2afe 100644 --- a/include/hashtab.h +++ b/include/hashtab.h @@ -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)); |