Lines Matching +full:2 +full:m
10 * 2. Redistributions in binary form must reproduce the above copyright
52 memb_init(struct memb_blocks *m) in memb_init() argument
54 memset(m->count, 0, m->num); in memb_init()
55 memset(m->mem, 0, m->size * m->num); in memb_init()
59 memb_alloc(struct memb_blocks *m) in memb_alloc() argument
63 for(i = 0; i < m->num; ++i) { in memb_alloc()
64 if(m->count[i] == 0) { in memb_alloc()
68 ++(m->count[i]); in memb_alloc()
69 return (void *)((char *)m->mem + (i * m->size)); in memb_alloc()
79 memb_free(struct memb_blocks *m, void *ptr) in memb_free() argument
86 ptr2 = (char *)m->mem; in memb_free()
87 for(i = 0; i < m->num; ++i) { in memb_free()
92 if(m->count[i] > 0) { in memb_free()
94 --(m->count[i]); in memb_free()
96 return m->count[i]; in memb_free()
98 ptr2 += m->size; in memb_free()