mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Fix c5471 signal handling + deallocation bug
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@44 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -68,6 +68,8 @@ void free(FAR void *mem)
|
||||
FAR struct mm_freenode_s *prev;
|
||||
FAR struct mm_freenode_s *next;
|
||||
|
||||
vdbg("Freeing %p\n", mem);
|
||||
|
||||
/* Protect against attempts to free a NULL reference */
|
||||
|
||||
if (!mem)
|
||||
|
||||
@@ -165,6 +165,8 @@ void mm_addregion(FAR void *heapstart, size_t heapsize)
|
||||
heapend = MM_ALIGN_DOWN((size_t)heapstart + (size_t)heapsize);
|
||||
heapsize = heapend - heapbase;
|
||||
|
||||
lldbg("Region %d: base=%p size=%d\n", IDX+1, heapstart, heapsize);
|
||||
|
||||
/* Add the size of this region to the total size of the heap */
|
||||
|
||||
g_heapsize += heapsize;
|
||||
|
||||
@@ -199,5 +199,6 @@ FAR void *malloc(size_t size)
|
||||
}
|
||||
|
||||
mm_givesemaphore();
|
||||
vdbg("Allocated %p\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user