Skip to content

Commit e94d907

Browse files
[kernel][memheap]fix RT_DEBUG_LOG errors.
Signed-off-by: WillianChan <[email protected]>
1 parent 114f305 commit e94d907

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/memheap.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ void rt_memheap_free(void *ptr)
553553
/* check magic */
554554
if (header_ptr->magic != (RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED))
555555
{
556-
RT_DEBUG_LOG("bad magic:0x%08x @ memheap\n", header_ptr->magic);
556+
RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("bad magic:0x%08x @ memheap\n",
557+
header_ptr->magic));
557558
}
558559
RT_ASSERT(header_ptr->magic == (RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED));
559560
/* check whether this block of memory has been over-written. */
@@ -774,7 +775,7 @@ void *rt_malloc(rt_size_t size)
774775
#ifdef RT_USING_MEMTRACE
775776
if (ptr == RT_NULL)
776777
{
777-
RT_DEBUG_LOG("malloc[%d] => NULL", size);
778+
RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("malloc[%d] => NULL", size));
778779
}
779780
else
780781
{
@@ -784,7 +785,7 @@ void *rt_malloc(rt_size_t size)
784785
else
785786
rt_memheap_setname(item, "<null>");
786787

787-
RT_DEBUG_LOG("malloc => 0x%08x : %d", ptr, size);
788+
RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("malloc => 0x%08x : %d", ptr, size));
788789
}
789790
#endif
790791

@@ -839,7 +840,7 @@ void *rt_realloc(void *rmem, rt_size_t newsize)
839840
#ifdef RT_USING_MEMTRACE
840841
if (new_ptr == RT_NULL)
841842
{
842-
RT_DEBUG_LOG("realloc[%d] => NULL", newsize);
843+
RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("realloc[%d] => NULL", newsize));
843844
}
844845
else
845846
{
@@ -849,7 +850,8 @@ void *rt_realloc(void *rmem, rt_size_t newsize)
849850
else
850851
rt_memheap_setname(item, "<null>");
851852

852-
RT_DEBUG_LOG("realloc => 0x%08x : %d", new_ptr, newsize);
853+
RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("realloc => 0x%08x : %d",
854+
new_ptr, newsize));
853855
}
854856
#endif
855857

@@ -873,11 +875,13 @@ void *rt_calloc(rt_size_t count, rt_size_t size)
873875
#ifdef RT_USING_MEMTRACE
874876
if (ptr == RT_NULL)
875877
{
876-
RT_DEBUG_LOG("calloc[%d x %d] => NULL", count, size);
878+
RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("calloc[%d x %d] => NULL",
879+
count, size));
877880
}
878881
else
879882
{
880-
RT_DEBUG_LOG("calloc => 0x%08x : %d", ptr, count * size);
883+
RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("calloc => 0x%08x : %d",
884+
ptr, count * size));
881885
}
882886
#endif
883887

0 commit comments

Comments
 (0)