ref: 89d5ad249f3f8660cd028e04471d7802b78a2e4b
parent: 4fb4c9536febc97aa53b65d78e2a9163ff0ff09a
author: Sijia Chen <sijchen@cisco.com>
date: Thu Jun 11 11:29:19 EDT 2015
add byte info in free
--- a/codec/common/src/memory_align.cpp
+++ b/codec/common/src/memory_align.cpp
@@ -130,7 +130,7 @@
void* pPointer = WelsCommon::WelsMalloc (kuiSize, kpTag, m_nCacheLineSize);
#ifdef MEMORY_MONITOR
if (pPointer != NULL) {
- const int32_t iMemoryLength = * ((int32_t*) ((uint8_t*)pPointer - sizeof (void**) - sizeof (
+ iMemoryLength = * ((int32_t*) ((uint8_t*)pPointer - sizeof (void**) - sizeof (
int32_t))) + m_nCacheLineSize - 1 + sizeof (void**) + sizeof (int32_t);
m_nMemoryUsageInBytes += iMemoryLength;
}
@@ -141,7 +141,7 @@
void CMemoryAlign::WelsFree (void* pPointer, const char* kpTag) {
if (pPointer) {
#ifdef MEMORY_MONITOR
- const int32_t iMemoryLength = * ((int32_t*) ((uint8_t*)pPointer - sizeof (void**) - sizeof (
+ iMemoryLength = * ((int32_t*) ((uint8_t*)pPointer - sizeof (void**) - sizeof (
int32_t))) + m_nCacheLineSize - 1 + sizeof (void**) + sizeof (int32_t);
m_nMemoryUsageInBytes -= iMemoryLength;
#endif//MEMORY_MONITOR