]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
removed direct call to malloc() from pool.c
authorYann Collet <cyan@fb.com>
Wed, 1 Nov 2017 00:43:24 +0000 (17:43 -0700)
committerYann Collet <cyan@fb.com>
Wed, 1 Nov 2017 00:43:24 +0000 (17:43 -0700)
lib/common/pool.c

index 1b0fe1035d2dcb826948b021c8c4f633a493fb99..98b109e72a8699ef17a58ef7adf9245af97d356c 100644 (file)
@@ -11,7 +11,6 @@
 
 /* ======   Dependencies   ======= */
 #include <stddef.h>  /* size_t */
-#include <stdlib.h>  /* malloc, calloc, free */
 #include "pool.h"
 
 /* ======   Compiler specifics   ====== */
@@ -115,7 +114,7 @@ POOL_ctx* POOL_create_advanced(size_t numThreads, size_t queueSize, ZSTD_customM
      * and full queues.
      */
     ctx->queueSize = queueSize + 1;
-    ctx->queue = (POOL_job*) malloc(ctx->queueSize * sizeof(POOL_job));
+    ctx->queue = (POOL_job*)ZSTD_malloc(ctx->queueSize * sizeof(POOL_job), customMem);
     ctx->queueHead = 0;
     ctx->queueTail = 0;
     ctx->numThreadsBusy = 0;