diff options
| author | sjg <sjg@NetBSD.org> | 2020-07-20 18:12:48 +0000 |
|---|---|---|
| committer | sjg <sjg@NetBSD.org> | 2020-07-20 18:12:48 +0000 |
| commit | ffa7e89921d69c422d7508d59c22ea638f9ceb09 (patch) | |
| tree | 71299217a4add03bef068f7e7516988fc10e2fd4 /usr.bin/make/hash.h | |
| parent | 5ac5c29815795fdf5011e19d9347d6222194b0ea (diff) | |
Make DEBUG_HASH less of a fire-hose.
Reporting keys on every lookup is overkill unless
playing with a new HASH, so wrap in #ifdef DEBUG_HASH_LOOKUP
Also add some stats at the end so we can see
final size and max chain length - maxchain is a better
variable name than maxlen.
Diffstat (limited to 'usr.bin/make/hash.h')
| -rw-r--r-- | usr.bin/make/hash.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/make/hash.h b/usr.bin/make/hash.h index fc35364fb1e..c814e6a6981 100644 --- a/usr.bin/make/hash.h +++ b/usr.bin/make/hash.h @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.14 2020/07/18 21:37:38 sjg Exp $ */ +/* $NetBSD: hash.h,v 1.15 2020/07/20 18:12:48 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -100,7 +100,7 @@ typedef struct Hash_Table { int size; /* Actual size of array. */ int numEntries; /* Number of entries in the table. */ int mask; /* Used to select bits for hashing. */ - int maxlen; /* max length of chain detected */ + int maxchain; /* max length of chain detected */ } Hash_Table; /* @@ -147,5 +147,6 @@ void Hash_DeleteEntry(Hash_Table *, Hash_Entry *); Hash_Entry *Hash_EnumFirst(Hash_Table *, Hash_Search *); Hash_Entry *Hash_EnumNext(Hash_Search *); void Hash_ForEach(Hash_Table *, void (*)(void *, void *), void *); +void Hash_DebugStats(Hash_Table *, const char *); #endif /* _HASH_H */ |
