#include "Exynos_OSAL_Log.h"
static int mem_cnt = 0;
+static int map_cnt = 0;
struct EXYNOS_SHAREDMEM_LIST;
typedef struct _EXYNOS_SHAREDMEM_LIST
pDeleteElement->mapAddr = NULL;
pDeleteElement->allocSize = 0;
- if (pDeleteElement->owner)
+ if (pDeleteElement->owner) {
ion_free(pDeleteElement->IONBuffer);
+ mem_cnt--;
+ }
pDeleteElement->IONBuffer = 0;
Exynos_OSAL_Free(pDeleteElement);
- mem_cnt--;
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory free count: %d", mem_cnt);
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory mem count: %d", mem_cnt);
}
pHandle->pAllocMemory = pSMList = NULL;
Exynos_OSAL_MutexUnlock(pHandle->hSMMutex);
mem_cnt++;
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory alloc count: %d", mem_cnt);
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory mem count: %d", mem_cnt);
EXIT:
return pBuffer;
pDeleteElement->mapAddr = NULL;
pDeleteElement->allocSize = 0;
- if (pDeleteElement->owner)
+ if (pDeleteElement->owner) {
ion_free(pDeleteElement->IONBuffer);
+ mem_cnt--;
+ }
pDeleteElement->IONBuffer = 0;
Exynos_OSAL_Free(pDeleteElement);
- mem_cnt--;
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory free count: %d", mem_cnt);
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory mem count: %d", mem_cnt);
EXIT:
return;
}
Exynos_OSAL_MutexUnlock(pHandle->hSMMutex);
- mem_cnt++;
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory alloc count: %d", mem_cnt);
+ map_cnt++;
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory map count: %d", map_cnt);
EXIT:
return pBuffer;
Exynos_OSAL_Free(pDeleteElement);
- mem_cnt--;
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory free count: %d", mem_cnt);
+ map_cnt--;
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "SharedMemory map count: %d", map_cnt);
EXIT:
return;