MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / max_block

Function max_block

src/utest/mem_tc.c:44–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42#define TEST_MEM_SIZE 1024
43
44static rt_size_t max_block(struct rt_small_mem *heap)
45{
46 struct rt_small_mem_item *mem;
47 rt_size_t max = 0, size;
48
49 for (mem = (struct rt_small_mem_item *)heap->heap_ptr;
50 mem != heap->heap_end;
51 mem = (struct rt_small_mem_item *)&heap->heap_ptr[mem->next])
52 {
53 if (((rt_ubase_t)mem->pool_ptr & 0x1) == 0)
54 {
55 size = MEM_SIZE(heap, mem);
56 if (size > max)
57 {
58 max = size;
59 }
60 }
61 }
62 return max;
63}
64
65static int _mem_cmp(void *ptr, rt_uint8_t v, rt_size_t size)
66{

Callers 3

mem_functional_testFunction · 0.85
mem_alloc_testFunction · 0.85
mem_realloc_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected