diff --git a/src/main/object.h b/src/main/object.h index 85e17d4d..2d77b285 100644 --- a/src/main/object.h +++ b/src/main/object.h @@ -47,20 +47,11 @@ struct object_head { if_assert_failed (obj)->object.refcount = 0; \ } while (0) -#define object_sanity_check_without_assert(obj) \ - do { \ - assertm((obj)->object.refcount >= 0, \ - "Object %s[%p] refcount underflow.", \ - (obj)->object.name, obj); \ - if_assert_failed (obj)->object.refcount = 0; \ - } while (0) - #define object_set_name(obj, objname) \ do { (obj)->object.name = (objname); } while (0) #define INIT_OBJECT(name) { 0, name } #else #define object_sanity_check(obj) -#define object_sanity_check_without_assert(obj) #define object_set_name(obj, name) #define INIT_OBJECT(name) { 0 } #endif /* CONFIG_DEBUG */ @@ -90,26 +81,4 @@ struct object_head { object_lock_debug(obj, "initialized"); \ } while (0) -/* These macros are here because of gcc warnings in uri.c . --witekfl */ -#define object_lock_without_assert(obj) \ - do { \ - object_sanity_check_without_assert(obj); \ - (obj)->object.refcount++; \ - object_lock_debug(obj, "incremented"); \ - } while (0) - -#define object_unlock_without_assert(obj) \ - do { \ - (obj)->object.refcount--; \ - object_lock_debug(obj, "decremented"); \ - object_sanity_check_without_assert(obj); \ - } while (0) - -#define object_nolock_without_assert(obj, name) \ - do { \ - object_set_name(obj, name); \ - object_sanity_check_without_assert(obj); \ - object_lock_debug(obj, "initialized"); \ - } while (0) - #endif diff --git a/src/protocol/uri.c b/src/protocol/uri.c index 1602e509..dd5cb090 100644 --- a/src/protocol/uri.c +++ b/src/protocol/uri.c @@ -1532,7 +1532,7 @@ get_uri_cache_entry(unsigned char *string, int length) return NULL; } - object_lock_without_assert(&uri_cache); /* was warning */ + object_lock(&uri_cache); return entry; } @@ -1556,7 +1556,7 @@ get_uri(unsigned char *string, enum uri_component components) if (!is_object_used(&uri_cache)) { uri_cache.map = init_hash8(); if (!uri_cache.map) return NULL; - object_nolock_without_assert(&uri_cache, "uri_cache"); + object_nolock(&uri_cache, "uri_cache"); } entry = get_uri_cache_entry(string, strlen(string)); @@ -1594,7 +1594,7 @@ done_uri(struct uri *uri) mem_free(entry); /* Last URI frees the cache */ - object_unlock_without_assert(&uri_cache); + object_unlock(&uri_cache); if (!is_object_used(&uri_cache)) free_hash(&uri_cache.map); }