Revert "mm: Check the function result with suitable macro."
This reverts commit 460d94729a
.
This commit is contained in:
parent
4e43fef5cd
commit
4cc13c19c6
@ -56,7 +56,6 @@ void mm_extend(FAR struct mm_heap_s *heap, FAR void *mem, size_t size,
|
|||||||
FAR struct mm_allocnode_s *newnode;
|
FAR struct mm_allocnode_s *newnode;
|
||||||
uintptr_t blockstart;
|
uintptr_t blockstart;
|
||||||
uintptr_t blockend;
|
uintptr_t blockend;
|
||||||
bool ret;
|
|
||||||
|
|
||||||
/* Make sure that we were passed valid parameters */
|
/* Make sure that we were passed valid parameters */
|
||||||
|
|
||||||
@ -78,8 +77,7 @@ void mm_extend(FAR struct mm_heap_s *heap, FAR void *mem, size_t size,
|
|||||||
|
|
||||||
/* Take the memory manager mutex */
|
/* Take the memory manager mutex */
|
||||||
|
|
||||||
ret = mm_lock(heap);
|
DEBUGVERIFY(mm_lock(heap));
|
||||||
DEBUGASSERT(ret);
|
|
||||||
|
|
||||||
/* Get the terminal node in the old heap. The block to extend must
|
/* Get the terminal node in the old heap. The block to extend must
|
||||||
* immediately follow this node.
|
* immediately follow this node.
|
||||||
|
@ -61,7 +61,6 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart,
|
|||||||
FAR struct mm_freenode_s *node;
|
FAR struct mm_freenode_s *node;
|
||||||
uintptr_t heapbase;
|
uintptr_t heapbase;
|
||||||
uintptr_t heapend;
|
uintptr_t heapend;
|
||||||
bool ret;
|
|
||||||
#if CONFIG_MM_REGIONS > 1
|
#if CONFIG_MM_REGIONS > 1
|
||||||
int IDX;
|
int IDX;
|
||||||
|
|
||||||
@ -92,8 +91,7 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart,
|
|||||||
|
|
||||||
kasan_register(heapstart, &heapsize);
|
kasan_register(heapstart, &heapsize);
|
||||||
|
|
||||||
ret = mm_lock(heap);
|
DEBUGVERIFY(mm_lock(heap));
|
||||||
DEBUGASSERT(ret);
|
|
||||||
|
|
||||||
/* Adjust the provided heap start and size.
|
/* Adjust the provided heap start and size.
|
||||||
*
|
*
|
||||||
|
@ -108,7 +108,6 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
|
|||||||
size_t alignsize;
|
size_t alignsize;
|
||||||
FAR void *ret = NULL;
|
FAR void *ret = NULL;
|
||||||
int ndx;
|
int ndx;
|
||||||
bool val;
|
|
||||||
|
|
||||||
/* Free the delay list first */
|
/* Free the delay list first */
|
||||||
|
|
||||||
@ -138,8 +137,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
|
|||||||
|
|
||||||
/* We need to hold the MM mutex while we muck with the nodelist. */
|
/* We need to hold the MM mutex while we muck with the nodelist. */
|
||||||
|
|
||||||
val = mm_lock(heap);
|
DEBUGVERIFY(mm_lock(heap));
|
||||||
DEBUGASSERT(val);
|
|
||||||
|
|
||||||
/* Get the location in the node list to start the search. Special case
|
/* Get the location in the node list to start the search. Special case
|
||||||
* really big allocations
|
* really big allocations
|
||||||
|
@ -57,7 +57,6 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment,
|
|||||||
size_t mask = (size_t)(alignment - 1);
|
size_t mask = (size_t)(alignment - 1);
|
||||||
size_t allocsize;
|
size_t allocsize;
|
||||||
size_t newsize;
|
size_t newsize;
|
||||||
bool ret;
|
|
||||||
|
|
||||||
/* Make sure that alignment is less than half max size_t */
|
/* Make sure that alignment is less than half max size_t */
|
||||||
|
|
||||||
@ -121,8 +120,7 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment,
|
|||||||
* nodelist.
|
* nodelist.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ret = mm_lock(heap);
|
DEBUGVERIFY(mm_lock(heap));
|
||||||
DEBUGASSERT(ret);
|
|
||||||
|
|
||||||
/* Get the node associated with the allocation and the next node after
|
/* Get the node associated with the allocation and the next node after
|
||||||
* the allocation.
|
* the allocation.
|
||||||
|
@ -72,7 +72,6 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem,
|
|||||||
size_t prevsize = 0;
|
size_t prevsize = 0;
|
||||||
size_t nextsize = 0;
|
size_t nextsize = 0;
|
||||||
FAR void *newmem;
|
FAR void *newmem;
|
||||||
bool ret;
|
|
||||||
|
|
||||||
/* If oldmem is NULL, then realloc is equivalent to malloc */
|
/* If oldmem is NULL, then realloc is equivalent to malloc */
|
||||||
|
|
||||||
@ -109,8 +108,7 @@ FAR void *mm_realloc(FAR struct mm_heap_s *heap, FAR void *oldmem,
|
|||||||
|
|
||||||
/* We need to hold the MM mutex while we muck with the nodelist. */
|
/* We need to hold the MM mutex while we muck with the nodelist. */
|
||||||
|
|
||||||
ret = mm_lock(heap);
|
DEBUGVERIFY(mm_lock(heap));
|
||||||
DEBUGASSERT(ret);
|
|
||||||
DEBUGASSERT(oldnode->preceding & MM_ALLOC_BIT);
|
DEBUGASSERT(oldnode->preceding & MM_ALLOC_BIT);
|
||||||
DEBUGASSERT(mm_heapmember(heap, oldmem));
|
DEBUGASSERT(mm_heapmember(heap, oldmem));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user