History

move the printing of MEMORY_CHECK part to more reasonable

sijchen committed 10 years ago

Commit 71aa5331 parent 6a0f0811 file · +3 −4Browse 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+3−4
@@ -70,6 +70,9 @@ void* WelsMalloc (const uint32_t kuiSize, const char* kpTag, const uint32_t kiAl · 69 unmodified lines
7070 const uint32_t kiPayloadSize = kuiSize;
7171
7272 uint8_t* pBuf = (uint8_t*) malloc (kiActualRequestedSize);
73+ if (NULL == pBuf)
74+ return NULL;
75+
7376 #ifdef MEMORY_CHECK
7477 if (fpMemChkPoint == NULL) {
7578 fpMemChkPoint = fopen ("./enc_mem_check_point.txt", "at+");
@@ -87,10 +90,6 @@ void* WelsMalloc (const uint32_t kuiSize, const char* kpTag, const uint32_t kiAl · 11 unmodified lines
8790 }
8891 #endif
8992 uint8_t* pAlignedBuffer;
90−
91− if (NULL == pBuf)
92− return NULL;
93−
9493 pAlignedBuffer = pBuf + kiAlignedBytes + kiSizeOfVoidPointer + kiSizeOfInt;
9594 pAlignedBuffer -= ((uintptr_t) pAlignedBuffer & kiAlignedBytes);
9695 * ((void**) (pAlignedBuffer - kiSizeOfVoidPointer)) = pBuf;

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