diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2009-06-22 13:46:00 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2009-06-22 13:46:00 +0000 |
| commit | 804c039c68e0193b8080b1022835b916b0cfb813 (patch) | |
| tree | fe0566f8b4c8fdcbd540cc79a37c5b58ca9bffc2 /lib/libmemstat | |
| parent | 5b6fe52101bc5f72598e424785434fd48575e123 (diff) | |
Notes
Diffstat (limited to 'lib/libmemstat')
| -rw-r--r-- | lib/libmemstat/memstat_malloc.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libmemstat/memstat_malloc.c b/lib/libmemstat/memstat_malloc.c index 70320f5861d1..28a48c660546 100644 --- a/lib/libmemstat/memstat_malloc.c +++ b/lib/libmemstat/memstat_malloc.c @@ -296,6 +296,7 @@ memstat_kvm_malloc(struct memory_type_list *list, void *kvm_handle) int hint_dontsearch, j, mp_maxcpus, ret; char name[MEMTYPE_MAXNAME]; struct malloc_type_stats mts[MEMSTAT_MAXCPU], *mtsp; + struct malloc_type_internal *mtip; struct malloc_type type, *typep; kvm_t *kvm; @@ -349,13 +350,11 @@ memstat_kvm_malloc(struct memory_type_list *list, void *kvm_handle) } /* - * Take advantage of explicit knowledge that - * malloc_type_internal is simply an array of statistics - * structures of number MAXCPU. Since our compile-time - * value for MAXCPU may differ from the kernel's, we - * populate our own array. + * Since our compile-time value for MAXCPU may differ from the + * kernel's, we populate our own array. */ - ret = kread(kvm, type.ks_handle, mts, mp_maxcpus * + mtip = type.ks_handle; + ret = kread(kvm, mtip->mti_stats, mts, mp_maxcpus * sizeof(struct malloc_type_stats), 0); if (ret != 0) { _memstat_mtl_empty(list); |
