summaryrefslogtreecommitdiff
path: root/thirdparty/zstd/common/pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/zstd/common/pool.c')
-rw-r--r--thirdparty/zstd/common/pool.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/thirdparty/zstd/common/pool.c b/thirdparty/zstd/common/pool.c
index e439fe1b0d..749fa4f2f7 100644
--- a/thirdparty/zstd/common/pool.c
+++ b/thirdparty/zstd/common/pool.c
@@ -146,6 +146,13 @@ void POOL_free(POOL_ctx *ctx) {
free(ctx);
}
+size_t POOL_sizeof(POOL_ctx *ctx) {
+ if (ctx==NULL) return 0; /* supports sizeof NULL */
+ return sizeof(*ctx)
+ + ctx->queueSize * sizeof(POOL_job)
+ + ctx->numThreads * sizeof(pthread_t);
+}
+
void POOL_add(void *ctxVoid, POOL_function function, void *opaque) {
POOL_ctx *ctx = (POOL_ctx *)ctxVoid;
if (!ctx) { return; }
@@ -191,4 +198,9 @@ void POOL_add(void *ctx, POOL_function function, void *opaque) {
function(opaque);
}
+size_t POOL_sizeof(POOL_ctx *ctx) {
+ if (ctx==NULL) return 0; /* supports sizeof NULL */
+ return sizeof(*ctx);
+}
+
#endif /* ZSTD_MULTITHREAD */