1
0
mirror of https://github.com/facebook/zstd.git synced 2025-03-06 16:56:49 +02:00

Merge pull request #3704 from void0red/dev

fileio_asyncio: handle malloc fails in AIO_ReadPool_create
This commit is contained in:
Yann Collet 2023-07-29 18:16:14 -07:00 committed by GitHub
commit 65dbb0b77b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -551,6 +551,7 @@ ReadPoolCtx_t* AIO_ReadPool_create(const FIO_prefs_t* prefs, size_t bufferSize)
AIO_IOPool_init(&ctx->base, prefs, AIO_ReadPool_executeReadJob, bufferSize); AIO_IOPool_init(&ctx->base, prefs, AIO_ReadPool_executeReadJob, bufferSize);
ctx->coalesceBuffer = (U8*) malloc(bufferSize * 2); ctx->coalesceBuffer = (U8*) malloc(bufferSize * 2);
if(!ctx->coalesceBuffer) EXM_THROW(100, "Allocation error : not enough memory");
ctx->srcBuffer = ctx->coalesceBuffer; ctx->srcBuffer = ctx->coalesceBuffer;
ctx->srcBufferLoaded = 0; ctx->srcBufferLoaded = 0;
ctx->completedJobsCount = 0; ctx->completedJobsCount = 0;