Files
zstd-rs/lib/common/pool.c
T
ddidderr 26b5e202ee feat(rust): port worker pool and pthread wrappers
Replace the common worker pool and debug pthread wrappers with ABI-compatible
Rust implementations. The pool preserves bounded-queue, resize, drain-on-free,
custom-allocator, and no-thread behavior while C supplies only the build-time
multithreading configuration bit.

This moves runtime support without changing C tests or public headers. Codec
and CLI implementations remain C while their dependencies are migrated.

Test Plan:
- cargo fmt --check
- cargo test --all-targets
- cargo clippy --all-targets -- -D warnings
- cargo build --release
- make -C tests poolTests
- ./tests/poolTests
- compile pool and threading shims with -Werror in MT and no-thread modes

Refs: rust/README.md
2026-07-10 20:05:35 +02:00

16 lines
364 B
C

#include "pool.h"
/* The implementation lives in rust/src/pool.rs. Rust cannot observe the C
* preprocessor configuration, so expose the one bit of configuration that
* changes the pool API's behavior. */
int ZSTD_rust_pool_is_multithreaded(void);
int ZSTD_rust_pool_is_multithreaded(void)
{
#ifdef ZSTD_MULTITHREAD
return 1;
#else
return 0;
#endif
}