Lines Matching refs:SIZEOF_STRUCT_MEM
100 #define SIZEOF_STRUCT_MEM RT_ALIGN(sizeof(struct rt_small_mem_item), RT_ALIGN_SIZE) macro
184 if ((end_align > (2 * SIZEOF_STRUCT_MEM)) && in rt_smem_init()
185 ((end_align - 2 * SIZEOF_STRUCT_MEM) >= start_addr)) in rt_smem_init()
188 mem_size = end_align - begin_align - 2 * SIZEOF_STRUCT_MEM; in rt_smem_init()
215 mem->next = small_mem->mem_size_aligned + SIZEOF_STRUCT_MEM; in rt_smem_init()
224 small_mem->heap_end->next = small_mem->mem_size_aligned + SIZEOF_STRUCT_MEM; in rt_smem_init()
225 small_mem->heap_end->prev = small_mem->mem_size_aligned + SIZEOF_STRUCT_MEM; in rt_smem_init()
305 if ((!MEM_ISUSED(mem)) && (mem->next - (ptr + SIZEOF_STRUCT_MEM)) >= size) in rt_smem_alloc()
310 if (mem->next - (ptr + SIZEOF_STRUCT_MEM) >= 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()
337 if (mem2->next != small_mem->mem_size_aligned + SIZEOF_STRUCT_MEM) 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()
376 RT_ASSERT((rt_uintptr_t)((rt_uint8_t *)mem + SIZEOF_STRUCT_MEM) % RT_ALIGN_SIZE == 0); in rt_smem_alloc()
380 (rt_uintptr_t)((rt_uint8_t *)mem + SIZEOF_STRUCT_MEM), in rt_smem_alloc()
384 return (rt_uint8_t *)mem + SIZEOF_STRUCT_MEM; in rt_smem_alloc()
438 mem = (struct rt_small_mem_item *)((rt_uint8_t *)rmem - SIZEOF_STRUCT_MEM); in rt_smem_realloc()
442 size = mem->next - ptr - SIZEOF_STRUCT_MEM; in rt_smem_realloc()
449 if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE < size) in rt_smem_realloc()
454 ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize; in rt_smem_realloc()
463 if (mem2->next != small_mem->mem_size_aligned + SIZEOF_STRUCT_MEM) in rt_smem_realloc()
508 mem = (struct rt_small_mem_item *)((rt_uint8_t *)rmem - SIZEOF_STRUCT_MEM); in rt_smem_free()
595 rt_kprintf(" size: %d\n", mem->next - position - SIZEOF_STRUCT_MEM); in memcheck()