zstdmt : better behavior when freeing a context right after a memory allocation error
wait for all jobs to be completed, so that freeing can happen safely
This commit is contained in:
parent
d6770f80af
commit
377abcc02c
@ -1014,8 +1014,10 @@ size_t ZSTDMT_compressStream_generic(ZSTDMT_CCtx* mtctx,
|
||||
if (input->size > input->pos) { /* support NULL input */
|
||||
if (mtctx->inBuff.buffer.start == NULL) {
|
||||
mtctx->inBuff.buffer = ZSTDMT_getBuffer(mtctx->bufPool);
|
||||
if (mtctx->inBuff.buffer.start == NULL)
|
||||
if (mtctx->inBuff.buffer.start == NULL) {
|
||||
ZSTDMT_waitForAllJobsCompleted(mtctx);
|
||||
return ERROR(memory_allocation);
|
||||
}
|
||||
mtctx->inBuff.filled = 0;
|
||||
}
|
||||
{ size_t const toLoad = MIN(input->size - input->pos, mtctx->inBuffSize - mtctx->inBuff.filled);
|
||||
|
Loading…
x
Reference in New Issue
Block a user