[bug][kernel][heap] 将内存堆保护机制由FIFO改为PRIO
This commit is contained in:
parent
2884700817
commit
b2dd3f00f0
|
@ -250,7 +250,7 @@ void rt_system_heap_init(void *begin_addr, void *end_addr)
|
|||
rt_mem_setname(heap_end, "INIT");
|
||||
#endif
|
||||
|
||||
rt_sem_init(&heap_sem, "heap", 1, RT_IPC_FLAG_FIFO);
|
||||
rt_sem_init(&heap_sem, "heap", 1, RT_IPC_FLAG_PRIO);
|
||||
|
||||
/* initialize the lowest-free pointer to the start of the heap */
|
||||
lfree = (struct heap_mem *)heap_ptr;
|
||||
|
|
|
@ -155,7 +155,7 @@ rt_err_t rt_memheap_init(struct rt_memheap *memheap,
|
|||
item->next_free = item->prev_free = RT_NULL;
|
||||
|
||||
/* initialize semaphore lock */
|
||||
rt_sem_init(&(memheap->lock), name, 1, RT_IPC_FLAG_FIFO);
|
||||
rt_sem_init(&(memheap->lock), name, 1, RT_IPC_FLAG_PRIO);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_MEMHEAP,
|
||||
("memory heap: start addr 0x%08x, size %d, free list header 0x%08x\n",
|
||||
|
|
|
@ -363,7 +363,7 @@ void rt_system_heap_init(void *begin_addr, void *end_addr)
|
|||
npages = limsize / RT_MM_PAGE_SIZE;
|
||||
|
||||
/* initialize heap semaphore */
|
||||
rt_sem_init(&heap_sem, "heap", 1, RT_IPC_FLAG_FIFO);
|
||||
rt_sem_init(&heap_sem, "heap", 1, RT_IPC_FLAG_PRIO);
|
||||
|
||||
RT_DEBUG_LOG(RT_DEBUG_SLAB, ("heap[0x%x - 0x%x], size 0x%x, 0x%x pages\n",
|
||||
heap_start, heap_end, limsize, npages));
|
||||
|
|
Loading…
Reference in New Issue