Lines Matching refs:mms

125 	struct mm_share *mms, *next;  in mm_freelist()  local
127 for (mms = RB_ROOT(head); mms; mms = next) { in mm_freelist()
128 next = RB_NEXT(mmtree, head, mms); in mm_freelist()
129 RB_REMOVE(mmtree, head, mms); in mm_freelist()
131 free(mms); in mm_freelist()
133 mm_free(mmalloc, mms); in mm_freelist()
177 struct mm_share *mms, *tmp; in mm_malloc() local
186 RB_FOREACH(mms, mmtree, &mm->rb_free) { in mm_malloc()
187 if (mms->size >= size) in mm_malloc()
191 if (mms == NULL) in mm_malloc()
195 memset(mms->address, 0xd0, size); in mm_malloc()
197 tmp = mm_make_entry(mm, &mm->rb_allocated, mms->address, size); in mm_malloc()
200 mms->size -= size; in mm_malloc()
201 mms->address = (char *)mms->address + size; in mm_malloc()
203 if (mms->size == 0) { in mm_malloc()
204 RB_REMOVE(mmtree, &mm->rb_free, mms); in mm_malloc()
206 free(mms); in mm_malloc()
208 mm_free(mm->mmalloc, mms); in mm_malloc()
219 struct mm_share *mms, *prev, tmp; in mm_free() local
222 mms = RB_FIND(mmtree, &mm->rb_allocated, &tmp); in mm_free()
223 if (mms == NULL) in mm_free()
227 memset(mms->address, 0xd0, mms->size); in mm_free()
230 RB_REMOVE(mmtree, &mm->rb_allocated, mms); in mm_free()
231 if (RB_INSERT(mmtree, &mm->rb_free, mms) != NULL) in mm_free()
235 prev = mms; in mm_free()
259 prev->size += mms->size; in mm_free()
260 RB_REMOVE(mmtree, &mm->rb_free, mms); in mm_free()
262 free(mms); in mm_free()
264 mm_free(mm->mmalloc, mms); in mm_free()
266 prev = mms; in mm_free()
272 mms = RB_NEXT(mmtree, &mm->rb_free, prev); in mm_free()
273 if (mms == NULL) in mm_free()
276 if (MM_ADDRESS_END(prev) > mms->address) in mm_free()
278 mms->address, prev->address, prev->size); in mm_free()
279 if (MM_ADDRESS_END(prev) != mms->address) in mm_free()
282 prev->size += mms->size; in mm_free()
283 RB_REMOVE(mmtree, &mm->rb_free, mms); in mm_free()
286 free(mms); in mm_free()
288 mm_free(mm->mmalloc, mms); in mm_free()
296 struct mm_share *mms, *new; in mm_sync_list() local
299 RB_FOREACH(mms, mmtree, oldtree) { in mm_sync_list()
301 mm_memvalid(mmold, mms, sizeof(struct mm_share)); in mm_sync_list()
302 mm_memvalid(mm, mms->address, mms->size); in mm_sync_list()
305 memcpy(new, mms, sizeof(struct mm_share)); in mm_sync_list()