From 7aa4498eb5067d7acbfbb8a80ff05ca7c4cc4d72 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Mon, 20 Jul 2026 02:41:52 +0200 Subject: [PATCH] fix(decompress): match Rust trace context ABI Define the decompression trace projection with the exact unsigned-long-long representation used by the public trace API. The generic U64 typedef can be a different C type with the same width, which made the Rust trace view fail to compile when assigned the DCtx trace field. Test Plan: - ulimit -v 41943040; make -j1 --- lib/decompress/zstd_decompress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index 1966f2605..0d911279e 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -106,7 +106,10 @@ typedef struct { size_t dctx_size; } ZSTD_rustDctxView; -typedef U64 ZSTD_rustTraceCtx; +/* Rust exposes this as u64. Use the trace API's exact unsigned-long-long + * representation instead of U64, whose typedef may be a different C type on + * some targets even when it has the same width. */ +typedef unsigned long long ZSTD_rustTraceCtx; typedef ZSTD_rustTraceCtx (*ZSTD_rustTraceBeginFn)(const void* dctx); typedef void (*ZSTD_rustTraceEndFn)(ZSTD_rustTraceCtx traceCtx, const void* trace);