MCPcopy Create free account
hub / github.com/F-Stack/f-stack / memstat_mtl_find

Function memstat_mtl_find

tools/libmemstat/memstat.c:134–147  ·  view source on GitHub ↗

* Look for an existing memory_type entry in a memory_type list, based on the * allocator and name of the type. If not found, return NULL. No errno or * memstat error. */

Source from the content-addressed store, hash-verified

132 * memstat error.
133 */
134struct memory_type *
135memstat_mtl_find(struct memory_type_list *list, int allocator,
136 const char *name)
137{
138 struct memory_type *mtp;
139
140 LIST_FOREACH(mtp, &list->mtl_list, mt_list) {
141 if ((mtp->mt_allocator == allocator ||
142 allocator == ALLOCATOR_ANY) &&
143 strcmp(mtp->mt_name, name) == 0)
144 return (mtp);
145 }
146 return (NULL);
147}
148
149/*
150 * Allocate a new memory_type with the specificed allocator type and name,

Callers 5

mbprFunction · 0.85
memstat_sysctl_umaFunction · 0.85
memstat_kvm_umaFunction · 0.85
memstat_sysctl_mallocFunction · 0.85
memstat_kvm_mallocFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected