summaryrefslogtreecommitdiff
path: root/debian/patches/nodeihash0003-libihash-prefer-performance-degradation-over-failure.patch
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-10-30 12:57:06 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-10-30 12:57:06 +0100
commita224aefcfbd8b645f76b2d341f97f8f96e5d3991 (patch)
tree501400851bbf797966e6df0bd8861fd5077befff /debian/patches/nodeihash0003-libihash-prefer-performance-degradation-over-failure.patch
parented5751155a85a3913e4aee2f8e050751740fc8b6 (diff)
drop old patch series
Diffstat (limited to 'debian/patches/nodeihash0003-libihash-prefer-performance-degradation-over-failure.patch')
-rw-r--r--debian/patches/nodeihash0003-libihash-prefer-performance-degradation-over-failure.patch65
1 files changed, 0 insertions, 65 deletions
diff --git a/debian/patches/nodeihash0003-libihash-prefer-performance-degradation-over-failure.patch b/debian/patches/nodeihash0003-libihash-prefer-performance-degradation-over-failure.patch
deleted file mode 100644
index d4c78df9..00000000
--- a/debian/patches/nodeihash0003-libihash-prefer-performance-degradation-over-failure.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 920d550d22576e0bd5d09597cf8ce2c91a893713 Mon Sep 17 00:00:00 2001
-From: Justus Winter <4winter@informatik.uni-hamburg.de>
-Date: Sun, 7 Jun 2015 00:58:36 +0200
-Subject: [PATCH hurd 3/3] libihash: prefer performance degradation over
- failure
-
-* libihash/ihash.c (hurd_ihash_add): Add the item even though we are
-above the load factor if resizing failed.
----
- libihash/ihash.c | 18 +++++++++++++++---
- 1 file changed, 15 insertions(+), 3 deletions(-)
-
-diff --git a/libihash/ihash.c b/libihash/ihash.c
-index 76c695a..289fce5 100644
---- a/libihash/ihash.c
-+++ b/libihash/ihash.c
-@@ -303,18 +303,19 @@ hurd_ihash_add (hurd_ihash_t ht, hurd_ihash_key_t key, hurd_ihash_value_t item)
- {
- struct hurd_ihash old_ht = *ht;
- int was_added;
-+ int fatal = 0; /* bail out on allocation errors */
- unsigned int i;
-
- if (ht->size)
- {
- /* Only fill the hash table up to its maximum load factor. */
- if (hurd_ihash_get_load (ht) <= ht->max_load)
-+ add_one:
- if (add_one (ht, key, item))
- return 0;
- }
-
- /* The hash table is too small, and we have to increase it. */
-- ht->nr_items = 0;
- if (ht->size == 0)
- ht->size = HURD_IHASH_MIN_SIZE;
- else
-@@ -325,11 +326,22 @@ hurd_ihash_add (hurd_ihash_t ht, hurd_ihash_key_t key, hurd_ihash_value_t item)
-
- if (ht->items == NULL)
- {
-- *ht = old_ht;
-- return ENOMEM;
-+ if (fatal || old_ht.size == 0)
-+ {
-+ *ht = old_ht;
-+ return ENOMEM;
-+ }
-+
-+ /* We prefer performance degradation over failure. Therefore,
-+ we add the item even though we are above the load factor. If
-+ the table is full, this will fail. We set the fatal flag to
-+ avoid looping. */
-+ fatal = 1;
-+ goto add_one;
- }
-
- /* We have to rehash the old entries. */
-+ ht->nr_items = 0;
- for (i = 0; i < old_ht.size; i++)
- if (!index_empty (&old_ht, i))
- {
---
-2.1.4
-