Lines Matching refs:size
172 rt_size_t size) in rt_smem_init() argument
181 end_align = RT_ALIGN_DOWN((rt_uintptr_t)begin_addr + size, RT_ALIGN_SIZE); in rt_smem_init()
193 (rt_uintptr_t)begin_addr, (rt_uintptr_t)begin_addr + size); in rt_smem_init()
271 void *rt_smem_alloc(rt_smem_t m, rt_size_t size) in rt_smem_alloc() argument
277 if (size == 0) in rt_smem_alloc()
286 size = RT_ALIGN(size, RT_ALIGN_SIZE); in rt_smem_alloc()
289 if (size < MIN_SIZE_ALIGNED) in rt_smem_alloc()
290 size = MIN_SIZE_ALIGNED; in rt_smem_alloc()
292 if (size > small_mem->mem_size_aligned) in rt_smem_alloc()
300 ptr <= small_mem->mem_size_aligned - size; in rt_smem_alloc()
305 if ((!MEM_ISUSED(mem)) && (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) in rt_smem_alloc()
311 (size + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED)) in rt_smem_alloc()
323 ptr2 = ptr + SIZEOF_STRUCT_MEM + size; in rt_smem_alloc()
341 small_mem->parent.used += (size + SIZEOF_STRUCT_MEM); in rt_smem_alloc()
375 … RT_ASSERT((rt_uintptr_t)mem + SIZEOF_STRUCT_MEM + size <= (rt_uintptr_t)small_mem->heap_end); in rt_smem_alloc()
405 rt_size_t size; in rt_smem_realloc() local
442 size = mem->next - ptr - SIZEOF_STRUCT_MEM; in rt_smem_realloc()
443 if (size == newsize) in rt_smem_realloc()
449 if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE < size) in rt_smem_realloc()
452 small_mem->parent.used -= (size - newsize); in rt_smem_realloc()
483 rt_memcpy(nmem, rmem, size < newsize ? size : newsize); in rt_smem_realloc()
642 int size = MEM_SIZE(m, mem); in memtrace() local
645 if (size < 1024) in memtrace()
646 rt_kprintf("%5d", size); in memtrace()
647 else if (size < 1024 * 1024) in memtrace()
648 rt_kprintf("%4dK", size / 1024); in memtrace()
650 rt_kprintf("%4dM", size / (1024 * 1024)); in memtrace()