Changeset 3140 for trunk/src/kmk/hash.c
- Timestamp:
- Mar 14, 2018, 10:28:10 PM (7 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk
-
Property svn:mergeinfo
set to
/vendor/gnumake/current merged eligible
-
Property svn:mergeinfo
set to
-
trunk/src/kmk/hash.c
r2745 r3140 15 15 this program. If not, see <http://www.gnu.org/licenses/>. */ 16 16 17 #include "make .h"17 #include "makeint.h" 18 18 #include "hash.h" 19 19 #ifdef CONFIG_WITH_STRCACHE2 … … 21 21 #endif 22 22 23 24 /*#define CALLOC(t, n) ((t *) calloc (sizeof (t), (n)))*/25 23 #define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n))) 26 24 #define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n))) … … 32 30 33 31 /* Implement double hashing with open addressing. The table size is 34 always a power of two. The secondary ( `increment') hash function32 always a power of two. The secondary ('increment') hash function 35 33 is forced to return an odd-value, in order to be relatively prime 36 34 to the table size. This guarantees that the increment can … … 54 52 fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"), 55 53 ht->ht_size * (unsigned long) sizeof (struct token *)); 56 exit ( 1);54 exit (MAKE_TROUBLE); 57 55 } 58 56 … … 90 88 #endif /* CONFIG_WITH_STRCACHE2 */ 91 89 92 /* Load an array of items into `ht'. */90 /* Load an array of items into 'ht'. */ 93 91 94 92 void … … 119 117 } 120 118 121 /* Returns the address of the table slot matching `key'. If `key' is119 /* Returns the address of the table slot matching 'key'. If 'key' is 122 120 not found, return the address of an empty slot suitable for 123 inserting `key'. The caller is responsible for incrementing121 inserting 'key'. The caller is responsible for incrementing 124 122 ht_fill on insertion. */ 125 123
Note:
See TracChangeset
for help on using the changeset viewer.