summaryrefslogtreecommitdiffstats
path: root/lib/libmemstat/memstat_internal.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-08-01 13:18:21 +0000
committerrwatson <rwatson@FreeBSD.org>2005-08-01 13:18:21 +0000
commit5032db6d57a3e8e30b4743d50494ce0fe47d0b96 (patch)
tree6861b8882f5a24ac61a27e8b26b5cdfc4d6acfcd /lib/libmemstat/memstat_internal.h
parent05cc0ffa4ec239c44179d406376baa6a0cf25aaf (diff)
downloadFreeBSD-src-5032db6d57a3e8e30b4743d50494ce0fe47d0b96.zip
FreeBSD-src-5032db6d57a3e8e30b4743d50494ce0fe47d0b96.tar.gz
Correct two libmemstat(3) bugs:
- Move memory_type_list flushing logic from memstat_mtl_free() to _memstat_mtl_empty(), a libmemstat-internal function that can be called from other parts of the library. Invoke _memstat_mtl_empty() from memstat_mtl_free(), which also frees the containing list structure. Invoke _memstat_mtl_empty() instead of memstat_mtl_free() in various error cases in memstat_malloc.c and memstat_uma.c, which previously resulted in the list being freed prematurely. - Reverse the order of updating the mt_kegfree and mt_free fields of the memory_type in memstat_uma.c, otherwise keg free items won't be counted properly for non-secondary zones. MFC after: 3 days
Diffstat (limited to 'lib/libmemstat/memstat_internal.h')
-rw-r--r--lib/libmemstat/memstat_internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libmemstat/memstat_internal.h b/lib/libmemstat/memstat_internal.h
index 838eaa6..7123518 100644
--- a/lib/libmemstat/memstat_internal.h
+++ b/lib/libmemstat/memstat_internal.h
@@ -116,6 +116,7 @@ struct memory_type_list {
int mtl_error;
};
+void _memstat_mtl_empty(struct memory_type_list *list);
struct memory_type *_memstat_mt_allocate(struct memory_type_list *list,
int allocator, const char *name);
void _memstat_mt_reset_stats(struct memory_type *mtp);
OpenPOWER on IntegriCloud