mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-21 00:27:19 +08:00
[Kernel] Add magic checking in rt_memheap_free routine.
This commit is contained in:
parent
1bd91f8b05
commit
c1d2e97c78
@ -517,6 +517,7 @@ void rt_memheap_free(void *ptr)
|
||||
|
||||
/* check magic */
|
||||
RT_ASSERT((header_ptr->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
|
||||
RT_ASSERT(header_ptr->magic & RT_MEMHEAP_USED);
|
||||
/* check whether this block of memory has been over-written. */
|
||||
RT_ASSERT((header_ptr->next->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user