Lines Matching refs:mem
45 void *mem; in mem_acquire() local
52 mem = *mem_head; in mem_acquire()
53 memcpy(&head, mem, sizeof(head)); in mem_acquire()
62 return mem; in mem_acquire()
68 void mem_release(void *mem, void **mem_head) in mem_release() argument
79 memcpy(mem, mem_head, sizeof(mem)); in mem_release()
82 *((uint16_t *)MROUND((uint8_t *)mem + sizeof(mem))) = free_count; in mem_release()
84 *mem_head = mem; in mem_release()
105 uint16_t mem_index_get(const void *mem, const void *mem_pool, uint16_t mem_size) in mem_index_get() argument
107 return ((uint8_t *)mem - (uint8_t *)mem_pool) / mem_size; in mem_index_get()
148 void *mem; in mem_ut() local
161 mem = mem_acquire(&mem_free); in mem_ut()
167 memcpy(mem, &mem_used, sizeof(mem)); in mem_ut()
168 mem_used = mem; in mem_ut()
171 mem = mem_acquire(&mem_free); in mem_ut()
172 if (mem) { in mem_ut()
179 mem = mem_used; in mem_ut()
180 memcpy(&mem_used, mem, sizeof(void *)); in mem_ut()
181 mem_release(mem, &mem_free); in mem_ut()
189 if (mem != mem_free) { in mem_ut()