Changeset 1391 for branches/GNU/src/gcc/include/hashtab.h
- Timestamp:
- Apr 27, 2004, 8:39:34 PM (21 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 dir.info 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/include/hashtab.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r1390 r1391 1 1 /* An expandable hash tables datatype. 2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.2 Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. 3 3 Contributed by Vladimir Makarov (vmakarov@cygnus.com). 4 4 … … 37 37 #endif /* __cplusplus */ 38 38 39 #include <ansidecl.h> 39 #include "ansidecl.h" 40 41 #ifndef GTY 42 #define GTY(X) 43 #endif 40 44 41 45 /* The type for a hash code. */ … … 64 68 typedef int (*htab_trav) PARAMS ((void **, void *)); 65 69 70 /* Memory-allocation function, with the same functionality as calloc(). 71 Iff it returns NULL, the hash table implementation will pass an error 72 code back to the user, so if your code doesn't handle errors, 73 best if you use xcalloc instead. */ 74 typedef PTR (*htab_alloc) PARAMS ((size_t, size_t)); 75 76 /* We also need a free() routine. */ 77 typedef void (*htab_free) PARAMS ((PTR)); 78 66 79 /* Hash tables are of the following type. The structure 67 80 (implementation) of this type is not needed for using the hash … … 69 82 functions mentioned below. */ 70 83 71 struct htab 84 struct htab GTY(()) 72 85 { 73 86 /* Pointer to hash function. */ … … 81 94 82 95 /* Table itself. */ 83 PTR * entries;96 PTR * GTY ((use_param (""), length ("%h.size"))) entries; 84 97 85 98 /* Current size (in entries) of the hash table */ … … 100 113 unsigned int collisions; 101 114 102 /* This is non-zero if we are allowed to return NULL for function calls103 that allocate memory. */104 int return_allocation_failure;115 /* Pointers to allocate/free functions. */ 116 htab_alloc alloc_f; 117 htab_free free_f; 105 118 }; 106 119 … … 112 125 /* The prototypes of the package functions. */ 113 126 114 extern htab_t htab_create PARAMS ((size_t, htab_hash, 115 htab_eq, htab_del)); 127 extern htab_t htab_create_alloc PARAMS ((size_t, htab_hash, 128 htab_eq, htab_del, 129 htab_alloc, htab_free)); 116 130 117 /* This function is like htab_create, but may return NULL if memory 118 allocation fails, and also signals that htab_find_slot_with_hash and 119 htab_find_slot are allowed to return NULL when inserting. */ 120 extern htab_t htab_try_create PARAMS ((size_t, htab_hash, 121 htab_eq, htab_del)); 131 /* Backward-compatibility functions. */ 132 extern htab_t htab_create PARAMS ((size_t, htab_hash, htab_eq, htab_del)); 133 extern htab_t htab_try_create PARAMS ((size_t, htab_hash, htab_eq, htab_del)); 134 122 135 extern void htab_delete PARAMS ((htab_t)); 123 136 extern void htab_empty PARAMS ((htab_t)); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.