diff options
author | Simon J. Gerraty <sjg@FreeBSD.org> | 2021-06-25 18:16:24 +0000 |
---|---|---|
committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2021-06-25 18:16:24 +0000 |
commit | ee914ef902ae018bd4f67192832120f9bf05651f (patch) | |
tree | 4974406fb050a22beaceba7bd0d2dcedd0b49421 /hash.h | |
parent | 8b6f73e37baf5c37946844ec335a84856b1a9033 (diff) | |
download | src-ee914ef902ae018bd4f67192832120f9bf05651f.tar.gz src-ee914ef902ae018bd4f67192832120f9bf05651f.zip |
Import bmake-20210621vendor/NetBSD/bmake/20210621
Lots more unit tests and code cleanup
Relevant changes from ChangeLog
o job.c: Print -de error information when running multiple jobs
o var.c: only report error for unmatched regex subexpression
when linting (-dL) since we cannot tell when an unmatched
subexpression is an expected result.
reduce memory allocations in the modifiers ':D' and ':U'
reduce memory allocation and strlen calls in modifier ':from=to'
in the ':Q' modifier, only allocate memory if necessary
improve performance for LazyBuf
reduce debug logging and memory allocation for ${:U...}
reduce verbosity of the -dv debug logging for standard cases
fix double varname expansion in the variable modifier '::='
o var.c: avoid evaluating many modifiers in parse only mode
in strict mode (-dL) many variable references are parsed twice,
the first time just to report parse errors early, so we want to
avoid side effects and wasted effort to the extent possible.
Diffstat (limited to 'hash.h')
-rw-r--r-- | hash.h | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.38 2020/12/15 01:23:55 rillig Exp $ */ +/* $NetBSD: hash.h,v 1.40 2021/04/11 12:46:54 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -124,9 +124,9 @@ void HashTable_Init(HashTable *); void HashTable_Done(HashTable *); HashEntry *HashTable_FindEntry(HashTable *, const char *); void *HashTable_FindValue(HashTable *, const char *); -unsigned int Hash_Hash(const char *); -void *HashTable_FindValueHash(HashTable *, const char *, unsigned int); -HashEntry *HashTable_CreateEntry(HashTable *, const char *, Boolean *); +unsigned int Hash_Substring(Substring); +void *HashTable_FindValueBySubstringHash(HashTable *, Substring, unsigned int); +HashEntry *HashTable_CreateEntry(HashTable *, const char *, bool *); HashEntry *HashTable_Set(HashTable *, const char *, void *); void HashTable_DeleteEntry(HashTable *, HashEntry *); void HashTable_DebugStats(HashTable *, const char *); @@ -146,16 +146,16 @@ HashSet_Done(HashSet *set) HashTable_Done(&set->tbl); } -MAKE_INLINE Boolean +MAKE_INLINE bool HashSet_Add(HashSet *set, const char *key) { - Boolean isNew; + bool isNew; (void)HashTable_CreateEntry(&set->tbl, key, &isNew); return isNew; } -MAKE_INLINE Boolean +MAKE_INLINE bool HashSet_Contains(HashSet *set, const char *key) { return HashTable_FindEntry(&set->tbl, key) != NULL; |