]> git.ipfire.org Git - thirdparty/zstd.git/commit
introduce macros STORE_OFFSET() and STORE_REPCODE()
authorYann Collet <cyan@fb.com>
Fri, 24 Dec 2021 05:58:08 +0000 (21:58 -0800)
committerYann Collet <cyan@fb.com>
Fri, 24 Dec 2021 06:03:30 +0000 (22:03 -0800)
commit1aed962216373a6683ff6f26e4ae0ff8fa62f4e4
tree665aa1b7fb7872ec83dd3c802d47bbe54db555db
parentbec7bbb5a4b7af89f318202df5b157de9d184015
introduce macros STORE_OFFSET() and STORE_REPCODE()

this meant to abstract the sumtype representation required
to transfert `offcode` to `ZSTD_storeSeq()`.

Unfortunately, the sumtype numeric representation is currently a leaky abstraction
that has permeated many other parts of the code,
especially within `zstd_lazy.c` and also within `zstd_opt.c` and `zstd_compress.c`.

While this PR makes a good job a transfering a large nb of call sites
to using the new macros, there are still a few sites where this transformation is more complex,
or where the numeric representation itself it used "as is".

One of the problematics area is the decision to use the numeric format of the sumtype
within the match finders of `zstd_lazy`.

This commit doesn't change the behavior, it only introduces and employes the macros,
but eventually the resulting code remains identical.

At target, if the numeric representation of the sumtype can be completely abstracted
and no other part of the code depends on it,
it will be possible to move it towards something slightly more efficient.
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h
lib/compress/zstd_double_fast.c
lib/compress/zstd_fast.c
lib/compress/zstd_lazy.c
lib/compress/zstd_ldm.c
lib/compress/zstd_opt.c
tests/decodecorpus.c