deflate_state *s_g;
public:
+ /**
+ * @brief Prepare the benchmark fixture by allocating and initializing working data.
+ *
+ * Allocates two 64-byte-aligned arrays of `uint16_t` (one of size HASH_SIZE, one of size MAX_RANDOM_INTS),
+ * fills them with pseudorandom `uint16_t` values, allocates a `deflate_state` structure, and sets
+ * its `head` and `prev` pointers to the allocated arrays.
+ *
+ * @param state Benchmark-provided state object from Google Benchmark (supplied by the framework).
+ */
void SetUp(const ::benchmark::State& state) {
l0 = (uint16_t *)zng_alloc_aligned(HASH_SIZE * sizeof(uint16_t), 64);
for (uint32_t i = 0; i < HASH_SIZE; i++) {
- l0[i] = rand();
+ l0[i] = (uint16_t)rand();
}
l1 = (uint16_t *)zng_alloc_aligned(MAX_RANDOM_INTS * sizeof(uint16_t), 64);
for (int32_t i = 0; i < MAX_RANDOM_INTS; i++) {
- l1[i] = rand();
+ l1[i] = (uint16_t)rand();
}
deflate_state *s = (deflate_state*)malloc(sizeof(deflate_state));
BENCHMARK_SLIDEHASH(lasx, slide_hash_lasx, test_cpu_features.loongarch.has_lasx);
#endif
-#endif
+#endif
\ No newline at end of file