commit
fa273ca817
|
@ -94,10 +94,6 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_MemboxInit(VOID *pool, UINT32 poolSize, UINT32
|
||||||
|
|
||||||
MEMBOX_LOCK(intSave);
|
MEMBOX_LOCK(intSave);
|
||||||
boxInfo->uwBlkSize = LOS_MEMBOX_ALLIGNED(blkSize + OS_MEMBOX_NODE_HEAD_SIZE);
|
boxInfo->uwBlkSize = LOS_MEMBOX_ALLIGNED(blkSize + OS_MEMBOX_NODE_HEAD_SIZE);
|
||||||
if (boxInfo->uwBlkSize == 0) {
|
|
||||||
MEMBOX_UNLOCK(intSave);
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
|
||||||
boxInfo->uwBlkNum = (poolSize - sizeof(LOS_MEMBOX_INFO)) / boxInfo->uwBlkSize;
|
boxInfo->uwBlkNum = (poolSize - sizeof(LOS_MEMBOX_INFO)) / boxInfo->uwBlkSize;
|
||||||
boxInfo->uwBlkCnt = 0;
|
boxInfo->uwBlkCnt = 0;
|
||||||
if (boxInfo->uwBlkNum == 0) {
|
if (boxInfo->uwBlkNum == 0) {
|
||||||
|
|
|
@ -919,10 +919,6 @@ STATIC INLINE VOID *OsMemAlloc(struct OsMemPoolHead *pool, UINT32 size, UINT32 i
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UINT32 allocSize = OS_MEM_ALIGN(size + OS_MEM_NODE_HEAD_SIZE, OS_MEM_ALIGN_SIZE);
|
UINT32 allocSize = OS_MEM_ALIGN(size + OS_MEM_NODE_HEAD_SIZE, OS_MEM_ALIGN_SIZE);
|
||||||
if (allocSize == 0) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if OS_MEM_EXPAND_ENABLE
|
#if OS_MEM_EXPAND_ENABLE
|
||||||
retry:
|
retry:
|
||||||
#endif
|
#endif
|
||||||
|
@ -1531,13 +1527,13 @@ STATIC INLINE VOID OsMemMagicCheckPrint(struct OsMemNodeHead **tmpNode)
|
||||||
|
|
||||||
STATIC UINT32 OsMemAddrValidCheckPrint(const VOID *pool, struct OsMemFreeNodeHead **tmpNode)
|
STATIC UINT32 OsMemAddrValidCheckPrint(const VOID *pool, struct OsMemFreeNodeHead **tmpNode)
|
||||||
{
|
{
|
||||||
if (!OsMemAddrValidCheck(pool, (*tmpNode)->prev)) {
|
if (((*tmpNode)->prev != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->prev)) {
|
||||||
PRINT_ERR("[%s], %d, memory check error!\n"
|
PRINT_ERR("[%s], %d, memory check error!\n"
|
||||||
" freeNode.prev:%#x is out of legal mem range\n",
|
" freeNode.prev:%#x is out of legal mem range\n",
|
||||||
__FUNCTION__, __LINE__, (*tmpNode)->prev);
|
__FUNCTION__, __LINE__, (*tmpNode)->prev);
|
||||||
return LOS_NOK;
|
return LOS_NOK;
|
||||||
}
|
}
|
||||||
if (!OsMemAddrValidCheck(pool, (*tmpNode)->next)) {
|
if (((*tmpNode)->next != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->next)) {
|
||||||
PRINT_ERR("[%s], %d, memory check error!\n"
|
PRINT_ERR("[%s], %d, memory check error!\n"
|
||||||
" freeNode.next:%#x is out of legal mem range\n",
|
" freeNode.next:%#x is out of legal mem range\n",
|
||||||
__FUNCTION__, __LINE__, (*tmpNode)->next);
|
__FUNCTION__, __LINE__, (*tmpNode)->next);
|
||||||
|
|
Loading…
Reference in New Issue