History

remove build error if MEMORY_CHECK is on

Sijia Chen committed 11 years ago

Commit 4fb4c951 parent 52cd5d91 file · +9 −8Browse files

Showing the changes to codec/common/src/memory_align.cpp (1 of 1 file). Show all

Unified · Split

codec/common/src/memory_align.cpp+9−8
@@ -40,6 +40,7 @@ namespace WelsCommon { · 39 unmodified lines
4040 #ifdef MEMORY_CHECK
4141 static FILE* fpMemChkPoint;
4242 static uint32_t nCountRequestNum;
43+static int32_t iMemoryLength;
4344 #endif
4445
4546
@@ -71,8 +72,8 @@ void* WelsMalloc (const uint32_t kuiSize, const char* kpTag, const uint32_t kiAl · 25 unmodified lines
7172 uint8_t* pBuf = (uint8_t*) malloc (kiActualRequestedSize);
7273 #ifdef MEMORY_CHECK
7374 if (fpMemChkPoint == NULL) {
74− m_fpMemChkPoint = fopen ("./enc_mem_check_point.txt", "at+");
75− m_nCountRequestNum = 0;
75+ fpMemChkPoint = fopen ("./enc_mem_check_point.txt", "at+");
76+ nCountRequestNum = 0;
7677 }
7778
7879 if (fpMemChkPoint != NULL) {
@@ -101,10 +102,10 @@ void* WelsMalloc (const uint32_t kuiSize, const char* kpTag, const uint32_t kiAl · 22 unmodified lines
101102 void WelsFree (void* pPointer, const char* kpTag) {
102103 if (pPointer) {
103104 #ifdef MEMORY_CHECK
104− if (m_fpMemChkPoint != NULL) {
105+ if (fpMemChkPoint != NULL) {
105106 if (kpTag != NULL)
106107 fprintf (fpMemChkPoint, "WelsFree(), 0x%x - %s: \t%d\t bytes \n", (void*) (* (((void**) pPointer) - 1)), kpTag,
107− kiMemoryLength);
108+ iMemoryLength);
108109 else
109110 fprintf (fpMemChkPoint, "WelsFree(), 0x%x \n", (void*) (* (((void**) pPointer) - 1)));
110111 fflush (fpMemChkPoint);
@@ -129,9 +130,9 @@ void* CMemoryAlign::WelsMalloc (const uint32_t kuiSize, const char* kpTag) { · 18 unmodified lines
129130 void* pPointer = WelsCommon::WelsMalloc (kuiSize, kpTag, m_nCacheLineSize);
130131 #ifdef MEMORY_MONITOR
131132 if (pPointer != NULL) {
132− const int32_t kiMemoryLength = * ((int32_t*) ((uint8_t*)pPointer - sizeof (void**) - sizeof (
133+ const int32_t iMemoryLength = * ((int32_t*) ((uint8_t*)pPointer - sizeof (void**) - sizeof (
133134 int32_t))) + m_nCacheLineSize - 1 + sizeof (void**) + sizeof (int32_t);
134− m_nMemoryUsageInBytes += kiMemoryLength;
135+ m_nMemoryUsageInBytes += iMemoryLength;
135136 }
136137 #endif//MEMORY_MONITOR
137138 return pPointer;
@@ -140,9 +141,9 @@ void* CMemoryAlign::WelsMalloc (const uint32_t kuiSize, const char* kpTag) { · 2 unmodified lines
140141 void CMemoryAlign::WelsFree (void* pPointer, const char* kpTag) {
141142 if (pPointer) {
142143 #ifdef MEMORY_MONITOR
143− const int32_t kiMemoryLength = * ((int32_t*) ((uint8_t*)pPointer - sizeof (void**) - sizeof (
144+ const int32_t iMemoryLength = * ((int32_t*) ((uint8_t*)pPointer - sizeof (void**) - sizeof (
144145 int32_t))) + m_nCacheLineSize - 1 + sizeof (void**) + sizeof (int32_t);
145− m_nMemoryUsageInBytes -= kiMemoryLength;
146+ m_nMemoryUsageInBytes -= iMemoryLength;
146147 #endif//MEMORY_MONITOR
147148 }
148149 WelsCommon::WelsFree (pPointer, kpTag);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t