]> icculus.org git repositories - icculus/xz.git/commit
Remove lzma_init() and other init functions from liblzma API.
authorLasse Collin <lasse.collin@tukaani.org>
Tue, 30 Dec 2008 22:30:49 +0000 (00:30 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 30 Dec 2008 22:30:49 +0000 (00:30 +0200)
commit7ed9d943b31d3ee9c5fb2387e84a241ba33afe90
tree5f9107c718aa996be6850b431ba319584064c9d7
parent5cda29b5665004fc0f21d0c41d78022a6a559ab2
Remove lzma_init() and other init functions from liblzma API.
Half of developers were already forgetting to use these
functions, which could have caused total breakage in some future
liblzma version or even now if --enable-small was used. Now
liblzma uses pthread_once() to do the initializations unless
it has been built with --disable-threads which make these
initializations thread-unsafe.

When --enable-small isn't used, liblzma currently gets needlessly
linked against libpthread (on systems that have it). While it is
stupid for now, liblzma will need threads in future anyway, so
this stupidity will be temporary only.

When --enable-small is used, different code CRC32 and CRC64 is
now used than without --enable-small. This made the resulting
binary slightly smaller, but the main reason was to clean it up
and to handle the lack of lzma_init_check().

The pkg-config file lzma.pc was renamed to liblzma.pc. I'm not
sure if it works correctly and portably for static linking
(Libs.private includes -pthread or other operating system
specific flags). Hopefully someone complains if it is bad.

lzma_rc_prices[] is now included as a precomputed array even
with --enable-small. It's just 128 bytes now that it uses uint8_t
instead of uint32_t. Smaller array seemed to be at least as fast
as the more bloated uint32_t array on x86; hopefully it's not bad
on other architectures.
37 files changed:
configure.ac
src/common/mythread.h [new file with mode: 0644]
src/liblzma/api/Makefile.am
src/liblzma/api/lzma.h
src/liblzma/api/lzma/init.h [deleted file]
src/liblzma/check/Makefile.am
src/liblzma/check/check.c
src/liblzma/check/check.h
src/liblzma/check/check_init.c [deleted file]
src/liblzma/check/crc32_fast.c [moved from src/liblzma/check/crc32.c with 100% similarity]
src/liblzma/check/crc32_init.c [deleted file]
src/liblzma/check/crc32_small.c [new file with mode: 0644]
src/liblzma/check/crc32_tablegen.c
src/liblzma/check/crc64_fast.c [moved from src/liblzma/check/crc64.c with 100% similarity]
src/liblzma/check/crc64_small.c [new file with mode: 0644]
src/liblzma/check/crc64_tablegen.c
src/liblzma/common/Makefile.am
src/liblzma/common/common.h
src/liblzma/common/init.c [deleted file]
src/liblzma/common/init_decoder.c [deleted file]
src/liblzma/common/init_encoder.c [deleted file]
src/liblzma/liblzma.pc.in [moved from src/liblzma/lzma.pc.in with 57% similarity]
src/liblzma/lz/lz_encoder.c
src/liblzma/rangecoder/Makefile.am
src/liblzma/rangecoder/price.h
src/liblzma/rangecoder/price_table.c
src/liblzma/rangecoder/price_table_init.c [deleted file]
src/liblzma/rangecoder/price_tablegen.c
src/xz/Makefile.am
src/xz/main.c
src/xzdec/xzdec.c
tests/test_block_header.c
tests/test_check.c
tests/test_filter_flags.c
tests/test_index.c
tests/test_stream_flags.c
tests/tests.h