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
16 lines
364 B
C
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
|
|
}
|