Changeset 3140 for trunk/src/kmk/hash.c


Ignore:
Timestamp:
Mar 14, 2018, 10:28:10 PM (7 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

Location:
trunk/src/kmk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

  • trunk/src/kmk/hash.c

    r2745 r3140  
    1515this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1616
    17 #include "make.h"
     17#include "makeint.h"
    1818#include "hash.h"
    1919#ifdef CONFIG_WITH_STRCACHE2
     
    2121#endif
    2222
    23 
    24 /*#define       CALLOC(t, n) ((t *) calloc (sizeof (t), (n)))*/
    2523#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
    2624#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
     
    3230
    3331/* Implement double hashing with open addressing.  The table size is
    34    always a power of two.  The secondary (`increment') hash function
     32   always a power of two.  The secondary ('increment') hash function
    3533   is forced to return an odd-value, in order to be relatively prime
    3634   to the table size.  This guarantees that the increment can
     
    5452      fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"),
    5553               ht->ht_size * (unsigned long) sizeof (struct token *));
    56       exit (1);
     54      exit (MAKE_TROUBLE);
    5755    }
    5856
     
    9088#endif /* CONFIG_WITH_STRCACHE2 */
    9189
    92 /* Load an array of items into `ht'.  */
     90/* Load an array of items into 'ht'.  */
    9391
    9492void
     
    119117}
    120118
    121 /* Returns the address of the table slot matching `key'.  If `key' is
     119/* Returns the address of the table slot matching 'key'.  If 'key' is
    122120   not found, return the address of an empty slot suitable for
    123    inserting `key'.  The caller is responsible for incrementing
     121   inserting 'key'.  The caller is responsible for incrementing
    124122   ht_fill on insertion.  */
    125123
Note: See TracChangeset for help on using the changeset viewer.