aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/bison/lib/xhash.c
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-08-11 11:42:23 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-08-11 11:54:06 +0300
commitcd788243496b69e548998f9e3f9ff80e34977652 (patch)
tree0fd50f566b69bc2cfd0d9c4c18eea1b77d5ec276 /contrib/tools/bison/lib/xhash.c
parentc7230d56fb1b7998da0edb829f1751640da9c8b4 (diff)
downloadydb-cd788243496b69e548998f9e3f9ff80e34977652.tar.gz
Update contrib/tools/bison to 3.7.6
583623e1fb299df0a04a0aecdc47eb759ef412b9
Diffstat (limited to 'contrib/tools/bison/lib/xhash.c')
-rw-r--r--contrib/tools/bison/lib/xhash.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/tools/bison/lib/xhash.c b/contrib/tools/bison/lib/xhash.c
index 1e998d2d15..d358f4e52d 100644
--- a/contrib/tools/bison/lib/xhash.c
+++ b/contrib/tools/bison/lib/xhash.c
@@ -22,9 +22,6 @@
#include "xalloc.h"
-/* Same as hash_initialize, but invokes xalloc_die on memory
- exhaustion. */
-
Hash_table *
hash_xinitialize (size_t candidate, const Hash_tuning *tuning,
Hash_hasher hasher, Hash_comparator comparator,
@@ -36,3 +33,12 @@ hash_xinitialize (size_t candidate, const Hash_tuning *tuning,
xalloc_die ();
return res;
}
+
+void *
+hash_xinsert (Hash_table *table, void const *entry)
+{
+ void *res = hash_insert (table, entry);
+ if (!res)
+ xalloc_die ();
+ return res;
+}