diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-07-23 12:51:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-23 12:51:57 +0200 |
commit | 5c05388919092a9cecf4a79e0f9fc639af5645a6 (patch) | |
tree | 9ac4092b94ba5aa6a722b7be595e8321f2b721a3 /thirdparty/zstd/common/pool.c | |
parent | aa798ebf8fcc0a72c837c7daea63e6d9ef51ff30 (diff) | |
parent | 2c1764d5a90bb1f18a5fdce9ddd8115e8cdbcf88 (diff) |
Merge pull request #9785 from vnen/update-zstd
zstd: Update to upstream version 1.3.0
Diffstat (limited to 'thirdparty/zstd/common/pool.c')
-rw-r--r-- | thirdparty/zstd/common/pool.c | 12 |
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 */ |