History

Rename the decoder WelsMalloc to WelsMallocz

This function actually zero-initializes the allocated memory, thus make this clear in the function name. This makes the function name match the same behaviour in the encoder.

Martin Storsjö committed 11 years ago

Commit 869870e1 parent 9b442b312 files · +58 −58Browse files

Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 12 files). Show all

Unified · Split

codec/decoder/core/src/decoder.cpp+8−8
@@ -67,13 +67,13 @@ static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, cons · 66 unmodified lines
6767 return 1;
6868 }
6969
70− pPicBuf = (PPicBuff)WelsMalloc (sizeof (SPicBuff), "PPicBuff");
70+ pPicBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff");
7171
7272 if (NULL == pPicBuf) {
7373 return 1;
7474 }
7575
76− pPicBuf->ppPic = (PPicture*)WelsMalloc (kiSize * sizeof (PPicture), "PPicture*");
76+ pPicBuf->ppPic = (PPicture*)WelsMallocz (kiSize * sizeof (PPicture), "PPicture*");
7777
7878 if (NULL == pPicBuf->ppPic) {
7979 pPicBuf->iCapacity = 0;
@@ -109,13 +109,13 @@ static int32_t IncreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 29 unmodified lines
109109 return 1;
110110 }
111111
112− pPicNewBuf = (PPicBuff)WelsMalloc (sizeof (SPicBuff), "PPicBuff");
112+ pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff");
113113
114114 if (NULL == pPicNewBuf) {
115115 return 1;
116116 }
117117
118− pPicNewBuf->ppPic = (PPicture*)WelsMalloc (kiNewSize * sizeof (PPicture), "PPicture*");
118+ pPicNewBuf->ppPic = (PPicture*)WelsMallocz (kiNewSize * sizeof (PPicture), "PPicture*");
119119
120120 if (NULL == pPicNewBuf->ppPic) {
121121 pPicNewBuf->iCapacity = 0;
@@ -171,13 +171,13 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 49 unmodified lines
171171 return 1;
172172 }
173173
174− pPicNewBuf = (PPicBuff)WelsMalloc (sizeof (SPicBuff), "PPicBuff");
174+ pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff");
175175
176176 if (NULL == pPicNewBuf) {
177177 return 1;
178178 }
179179
180− pPicNewBuf->ppPic = (PPicture*)WelsMalloc (kiNewSize * sizeof (PPicture), "PPicture*");
180+ pPicNewBuf->ppPic = (PPicture*)WelsMallocz (kiNewSize * sizeof (PPicture), "PPicture*");
181181
182182 if (NULL == pPicNewBuf->ppPic) {
183183 pPicNewBuf->iCapacity = 0;
@@ -417,7 +417,7 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const · 233 unmodified lines
417417 pCtx->pDec = NULL; // need prefetch a new pic due to spatial size changed
418418
419419 if (pCtx->pCabacDecEngine == NULL)
420− pCtx->pCabacDecEngine = (SWelsCabacDecEngine*) WelsMalloc (sizeof (SWelsCabacDecEngine), "pCtx->pCabacDecEngine");
420+ pCtx->pCabacDecEngine = (SWelsCabacDecEngine*) WelsMallocz (sizeof (SWelsCabacDecEngine), "pCtx->pCabacDecEngine");
421421
422422 return ERR_NONE;
423423 }
@@ -508,7 +508,7 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa · 84 unmodified lines
508508 if (NULL == pCtx || NULL == kpParam)
509509 return 1;
510510
511− pCtx->pParam = (SDecodingParam*)WelsMalloc (sizeof (SDecodingParam), "SDecodingParam");
511+ pCtx->pParam = (SDecodingParam*)WelsMallocz (sizeof (SDecodingParam), "SDecodingParam");
512512
513513 if (NULL == pCtx->pParam)
514514 return 1;

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