From f8719c1aa128f5aa38e6c4b010196c1e619bc909 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Tue, 14 Aug 2007 13:18:50 +0000 Subject: [PATCH] please lint and doxygen. git-svn-id: file:///svn/unbound/trunk@513 be551aaa-1e26-0410-a405-d3ace91eadb9 --- testcode/checklocks.c | 4 +++- util/alloc.c | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/testcode/checklocks.c b/testcode/checklocks.c index d65dc2600..781e95e41 100644 --- a/testcode/checklocks.c +++ b/testcode/checklocks.c @@ -205,7 +205,9 @@ prot_store(struct checked_lock* lock) } } -size_t lock_get_mem(void* pp) +/** get memory held by lock */ +size_t +lock_get_mem(void* pp) { size_t s; struct checked_lock* lock = *(struct checked_lock**)pp; diff --git a/util/alloc.c b/util/alloc.c index 1350faf9d..2583d2e43 100644 --- a/util/alloc.c +++ b/util/alloc.c @@ -353,6 +353,7 @@ void *unbound_stat_realloc(void *ptr, size_t size) return res+16; } +/** log to file where alloc was done */ void *unbound_stat_malloc_log(size_t size, const char* file, int line, const char* func) { @@ -360,6 +361,7 @@ void *unbound_stat_malloc_log(size_t size, const char* file, int line, return unbound_stat_malloc(size); } +/** log to file where alloc was done */ void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file, int line, const char* func) { @@ -368,6 +370,7 @@ void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file, return unbound_stat_calloc(nmemb, size); } +/** log to file where free was done */ void unbound_stat_free_log(void *ptr, const char* file, int line, const char* func) { @@ -381,6 +384,7 @@ void unbound_stat_free_log(void *ptr, const char* file, int line, unbound_stat_free(ptr); } +/** log to file where alloc was done */ void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file, int line, const char* func) { @@ -389,12 +393,14 @@ void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file, return unbound_stat_realloc(ptr, size); } +/** special routine for region-allocator, print to log */ void *unbound_stat_malloc_region(size_t size) { log_info("region malloc(%u)", (unsigned)size); return unbound_stat_malloc(size); } +/** special routine for region-allocator, print to log */ void unbound_stat_free_region(void *ptr) { if(ptr && memcmp(ptr-8, &mem_special, sizeof(mem_special)) == 0) { -- 2.47.2