[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 03/14: libihash: enable fast insertions replacing tombstones
From: |
Samuel Thibault |
Subject: |
[hurd] 03/14: libihash: enable fast insertions replacing tombstones |
Date: |
Sun, 22 May 2016 01:15:21 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 736fa7a565e28425220be797235913d0f7b96acd
Author: Justus Winter <address@hidden>
Date: Sat Apr 30 00:19:41 2016 +0200
libihash: enable fast insertions replacing tombstones
* libihash/ihash.c (hurd_ihash_locp_add): Also replace tombstones.
---
libihash/ihash.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/libihash/ihash.c b/libihash/ihash.c
index c6143a5..2fc7093 100644
--- a/libihash/ihash.c
+++ b/libihash/ihash.c
@@ -287,17 +287,20 @@ hurd_ihash_locp_add (hurd_ihash_t ht, hurd_ihash_locp_t
locp,
/* In case of complications, fall back to hurd_ihash_add. */
if (ht->size == 0
|| item == NULL
- || item->value == _HURD_IHASH_DELETED
- || ! compare (ht, item->key, key)
+ || (hurd_ihash_value_valid (item->value)
+ && ! compare (ht, item->key, key))
|| hurd_ihash_get_effective_load (ht) > ht->max_load)
return hurd_ihash_add (ht, key, value);
- if (item->value == _HURD_IHASH_EMPTY)
+ if (! hurd_ihash_value_valid (item->value))
{
item->key = key;
ht->nr_items += 1;
- assert (ht->nr_free > 0);
- ht->nr_free -= 1;
+ if (item->value == _HURD_IHASH_EMPTY)
+ {
+ assert (ht->nr_free > 0);
+ ht->nr_free -= 1;
+ }
}
else
{
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 04/14: startup: fix blunder, (continued)
- [hurd] 04/14: startup: fix blunder, Samuel Thibault, 2016/05/21
- [hurd] 06/14: GNU Hurd 0.8, Samuel Thibault, 2016/05/21
- [hurd] 05/14: Complete changes to use -L instead of -Wl, -rpath-link, Samuel Thibault, 2016/05/21
- [hurd] 07/14: mach-defpager: fix panic invocation, Samuel Thibault, 2016/05/21
- [hurd] 02/14: libihash: fix corner case, Samuel Thibault, 2016/05/21
- [hurd] 12/14: libnetfs: treat disconnected shadow roots as virtual roots, Samuel Thibault, 2016/05/21
- [hurd] 14/14: Avoid superfluous locking of node, Samuel Thibault, 2016/05/21
- [hurd] 10/14: libdiskfs: cosmetic changes, Samuel Thibault, 2016/05/21
- [hurd] 09/14: libnetfs: rename 'diruser' to 'dircred', Samuel Thibault, 2016/05/21
- [hurd] 08/14: libnetfs: rename 'error' to 'err', Samuel Thibault, 2016/05/21
- [hurd] 03/14: libihash: enable fast insertions replacing tombstones,
Samuel Thibault <=
- [hurd] 11/14: Unify the short-circuit translator logic, Samuel Thibault, 2016/05/21
- [hurd] 13/14: utils/settrans: implement active translator stacking, Samuel Thibault, 2016/05/21