diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-07-23 21:17:15 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-07-23 21:17:15 +0000 |
commit | a465907b05115a58a5c1178300875d8dc1119cd1 (patch) | |
tree | 0102be81724a1f54a8c13019736a2b01cc0cdbfb /lib/libmemstat | |
parent | 4eb9d677d45bfe80d30ff8ae621a5246cc58790a (diff) | |
download | FreeBSD-src-a465907b05115a58a5c1178300875d8dc1119cd1.zip FreeBSD-src-a465907b05115a58a5c1178300875d8dc1119cd1.tar.gz |
Prefix two non-static libmemstat(3) internal functions with '_' symbols, to
try and discourage use outside the library.
Remove duplicate declaration of memstat_mtl_free() from memstat_internal.h,
as it's not internal, and the memstat.h definition suffices.
Diffstat (limited to 'lib/libmemstat')
-rw-r--r-- | lib/libmemstat/memstat.c | 8 | ||||
-rw-r--r-- | lib/libmemstat/memstat_internal.h | 5 | ||||
-rw-r--r-- | lib/libmemstat/memstat_malloc.c | 9 | ||||
-rw-r--r-- | lib/libmemstat/memstat_uma.c | 9 |
4 files changed, 12 insertions, 19 deletions
diff --git a/lib/libmemstat/memstat.c b/lib/libmemstat/memstat.c index cbab40a..29dd19e 100644 --- a/lib/libmemstat/memstat.c +++ b/lib/libmemstat/memstat.c @@ -99,9 +99,11 @@ memstat_mtl_find(struct memory_type_list *list, int allocator, /* * Allocate a new memory_type with the specificed allocator type and name, * then insert into the list. The structure will be zero'd. + * + * libmemstat(3) internal function. */ struct memory_type * -memstat_mt_allocate(struct memory_type_list *list, int allocator, +_memstat_mt_allocate(struct memory_type_list *list, int allocator, const char *name) { struct memory_type *mtp; @@ -122,9 +124,11 @@ memstat_mt_allocate(struct memory_type_list *list, int allocator, * Reset any libmemstat(3)-owned statistics in a memory_type record so that * it can be reused without incremental addition problems. Caller-owned * memory is left "as-is", and must be updated by the caller if desired. + * + * libmemstat(3) internal function. */ void -memstat_mt_reset_stats(struct memory_type *mtp) +_memstat_mt_reset_stats(struct memory_type *mtp) { int i; diff --git a/lib/libmemstat/memstat_internal.h b/lib/libmemstat/memstat_internal.h index 61eb795..edbf562 100644 --- a/lib/libmemstat/memstat_internal.h +++ b/lib/libmemstat/memstat_internal.h @@ -113,9 +113,8 @@ struct memory_type { */ LIST_HEAD(memory_type_list, memory_type); -void memstat_mtl_free(struct memory_type_list *list); -struct memory_type *memstat_mt_allocate(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); +void _memstat_mt_reset_stats(struct memory_type *mtp); #endif /* !_MEMSTAT_INTERNAL_H_ */ diff --git a/lib/libmemstat/memstat_malloc.c b/lib/libmemstat/memstat_malloc.c index 57e7f5c..3aed1cf 100644 --- a/lib/libmemstat/memstat_malloc.c +++ b/lib/libmemstat/memstat_malloc.c @@ -174,15 +174,10 @@ retry: if (hint_dontsearch == 0) { mtp = memstat_mtl_find(list, ALLOCATOR_MALLOC, mthp->mth_name); - /* - * Reset the statistics on a reused node. - */ - if (mtp != NULL) - memstat_mt_reset_stats(mtp); } else mtp = NULL; if (mtp == NULL) - mtp = memstat_mt_allocate(list, ALLOCATOR_MALLOC, + mtp = _memstat_mt_allocate(list, ALLOCATOR_MALLOC, mthp->mth_name); if (mtp == NULL) { memstat_mtl_free(list); @@ -196,7 +191,7 @@ retry: /* * Reset the statistics on a current node. */ - memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp); for (j = 0; j < maxcpus; j++) { mtsp = (struct malloc_type_stats *)p; diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c index 740fe23..49cc73a 100644 --- a/lib/libmemstat/memstat_uma.c +++ b/lib/libmemstat/memstat_uma.c @@ -175,15 +175,10 @@ retry: if (hint_dontsearch == 0) { mtp = memstat_mtl_find(list, ALLOCATOR_UMA, uthp->uth_name); - /* - * Reset the statistics on a reused node. - */ - if (mtp != NULL) - memstat_mt_reset_stats(mtp); } else mtp = NULL; if (mtp == NULL) - mtp = memstat_mt_allocate(list, ALLOCATOR_UMA, + mtp = _memstat_mt_allocate(list, ALLOCATOR_UMA, uthp->uth_name); if (mtp == NULL) { memstat_mtl_free(list); @@ -197,7 +192,7 @@ retry: /* * Reset the statistics on a current node. */ - memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp); mtp->mt_numallocs = uthp->uth_allocs; mtp->mt_numfrees = uthp->uth_frees; |