* 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. */
| 132 | * memstat error. |
| 133 | */ |
| 134 | struct memory_type * |
| 135 | memstat_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, |
no test coverage detected