[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[augeas-devel] augeas: master - * src/hash.c: mark some asserts as expensive



Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=70ae697121f6465a2d95f7b9eb33dacc98da8c17
Commit:        70ae697121f6465a2d95f7b9eb33dacc98da8c17
Parent:        e3063a656dc73b67bd071884bf29dd00b7c52b94
Author:        David Lutterkort <lutter redhat com>
AuthorDate:    Fri Mar 27 15:16:56 2009 -0700
Committer:     David Lutterkort <lutter redhat com>
CommitterDate: Fri Mar 27 15:16:56 2009 -0700

* src/hash.c: mark some asserts as expensive

---
 src/hash.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/hash.c b/src/hash.c
index 44b4da3..f35a9d2 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -533,7 +533,7 @@ void hash_insert(hash_t *hash, hnode_t *node, const void *key)
     assert (hash_val_t_bit != 0);
     assert (node->next == NULL);
     assert (hash->nodecount < hash->maxcount);	/* 1 */
-    assert (hash_lookup(hash, key) == NULL);	/* 2 */
+    expensive_assert (hash_lookup(hash, key) == NULL);	/* 2 */
 
     if (hash->dynamic && hash->nodecount >= hash->highmark)	/* 3 */
 	grow_table(hash);
@@ -603,7 +603,7 @@ hnode_t *hash_delete(hash_t *hash, hnode_t *node)
     hash_val_t chain;
     hnode_t *hptr;
 
-    assert (hash_lookup(hash, node->key) == node);	/* 1 */
+    expensive_assert (hash_lookup(hash, node->key) == node);	/* 1 */
     assert (hash_val_t_bit != 0);
 
     if (hash->dynamic && hash->nodecount <= hash->lowmark
@@ -659,7 +659,7 @@ hnode_t *hash_scan_delete(hash_t *hash, hnode_t *node)
     hash_val_t chain;
     hnode_t *hptr;
 
-    assert (hash_lookup(hash, node->key) == node);
+    expensive_assert (hash_lookup(hash, node->key) == node);
     assert (hash_val_t_bit != 0);
 
     chain = node->hkey & hash->mask;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]