Lines Matching refs:mms
121 struct mm_share *mms, *next; in mm_freelist() local
123 for (mms = RB_ROOT(head); mms; mms = next) { in mm_freelist()
124 next = RB_NEXT(mmtree, head, mms); in mm_freelist()
125 RB_REMOVE(mmtree, head, mms); in mm_freelist()
127 xfree(mms); in mm_freelist()
129 mm_free(mmalloc, mms); in mm_freelist()
172 struct mm_share *mms, *tmp; in mm_malloc() local
181 RB_FOREACH(mms, mmtree, &mm->rb_free) { in mm_malloc()
182 if (mms->size >= size) in mm_malloc()
186 if (mms == NULL) in mm_malloc()
190 memset(mms->address, 0xd0, size); in mm_malloc()
192 tmp = mm_make_entry(mm, &mm->rb_allocated, mms->address, size); in mm_malloc()
195 mms->size -= size; in mm_malloc()
196 mms->address = (u_char *)mms->address + size; in mm_malloc()
198 if (mms->size == 0) { in mm_malloc()
199 RB_REMOVE(mmtree, &mm->rb_free, mms); in mm_malloc()
201 xfree(mms); in mm_malloc()
203 mm_free(mm->mmalloc, mms); in mm_malloc()
214 struct mm_share *mms, *prev, tmp; in mm_free() local
217 mms = RB_FIND(mmtree, &mm->rb_allocated, &tmp); in mm_free()
218 if (mms == NULL) in mm_free()
222 memset(mms->address, 0xd0, mms->size); in mm_free()
225 RB_REMOVE(mmtree, &mm->rb_allocated, mms); in mm_free()
226 if (RB_INSERT(mmtree, &mm->rb_free, mms) != NULL) in mm_free()
230 prev = mms; in mm_free()
254 prev->size += mms->size; in mm_free()
255 RB_REMOVE(mmtree, &mm->rb_free, mms); in mm_free()
257 xfree(mms); in mm_free()
259 mm_free(mm->mmalloc, mms); in mm_free()
261 prev = mms; in mm_free()
267 mms = RB_NEXT(mmtree, &mm->rb_free, prev); in mm_free()
268 if (mms == NULL) in mm_free()
271 if (MM_ADDRESS_END(prev) > mms->address) in mm_free()
273 mms->address, prev->address, (u_long)prev->size); in mm_free()
274 if (MM_ADDRESS_END(prev) != mms->address) in mm_free()
277 prev->size += mms->size; in mm_free()
278 RB_REMOVE(mmtree, &mm->rb_free, mms); in mm_free()
281 xfree(mms); in mm_free()
283 mm_free(mm->mmalloc, mms); in mm_free()
291 struct mm_share *mms, *new; in mm_sync_list() local
294 RB_FOREACH(mms, mmtree, oldtree) { in mm_sync_list()
296 mm_memvalid(mmold, mms, sizeof(struct mm_share)); in mm_sync_list()
297 mm_memvalid(mm, mms->address, mms->size); in mm_sync_list()
300 memcpy(new, mms, sizeof(struct mm_share)); in mm_sync_list()