From caf9e96dc3958850f14b3ddba31003e5f2f2a700 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 26 Jan 2018 18:09:25 -0800 Subject: [PATCH] job mutex creation is checked --- lib/compress/zstdmt_compress.c | 44 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index 22560bfb1..865035691 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -467,26 +467,6 @@ struct ZSTDMT_CCtx_s { const ZSTD_CDict* cdict; }; -/* ZSTDMT_allocJobsTable() - * allocate and init a job table. - * update *nbJobsPtr to next power of 2 value, as size of table - * No reverse free() function is provided : just use ZSTD_free() */ -static ZSTDMT_jobDescription* ZSTDMT_createJobsTable(U32* nbJobsPtr, ZSTD_customMem cMem) -{ - U32 const nbJobsLog2 = ZSTD_highbit32(*nbJobsPtr) + 1; - U32 const nbJobs = 1 << nbJobsLog2; - ZSTDMT_jobDescription* const jobTable = ZSTD_calloc( - nbJobs * sizeof(ZSTDMT_jobDescription), cMem); - U32 jobNb; - if (jobTable==NULL) return NULL; - *nbJobsPtr = nbJobs; - for (jobNb=0; jobNb