Ignore:
Timestamp:
Mar 12, 2018, 8:32:29 PM (7 years ago)
Author:
bird
Message:

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/hash.c

    r2596 r3138  
    1515this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1616
    17 #include "make.h"
     17#include "makeint.h"
    1818#include "hash.h"
    1919
    20 #define CALLOC(t, n) ((t *) calloc (sizeof (t), (n)))
     20#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
    2121#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
    2222#define REALLOC(o, t, n) ((t *) xrealloc ((o), sizeof (t) * (n)))
     
    2727
    2828/* Implement double hashing with open addressing.  The table size is
    29    always a power of two.  The secondary (`increment') hash function
     29   always a power of two.  The secondary ('increment') hash function
    3030   is forced to return an odd-value, in order to be relatively prime
    3131   to the table size.  This guarantees that the increment can
     
    4949      fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"),
    5050               ht->ht_size * (unsigned long) sizeof (struct token *));
    51       exit (1);
     51      exit (MAKE_TROUBLE);
    5252    }
    5353
     
    6262}
    6363
    64 /* Load an array of items into `ht'.  */
     64/* Load an array of items into 'ht'.  */
    6565
    6666void
     
    7676}
    7777
    78 /* Returns the address of the table slot matching `key'.  If `key' is
     78/* Returns the address of the table slot matching 'key'.  If 'key' is
    7979   not found, return the address of an empty slot suitable for
    80    inserting `key'.  The caller is responsible for incrementing
     80   inserting 'key'.  The caller is responsible for incrementing
    8181   ht_fill on insertion.  */
    8282
Note: See TracChangeset for help on using the changeset viewer.