1
0
mirror of https://github.com/lz4/lz4.git synced 2026-10-24 01:48:57 +03:00
Files
lz4/programs/lz4conf.h
Yann Collet 88ed0b630e api: LZ4F_getMaxNbWorkers() reports multi-threading support ; CLI thread cap follows liblz4, lz4 -V reports multithreading (checkpoint)
LZ4F_getMaxNbWorkers() (static linking only, experimental like nbWorkers) :
0 when liblz4 is built without LZ4F_MULTITHREAD, otherwise the cap of nbWorkers,
now 1024 on 64-bit systems and 128 on 32-bit ones (was 200).
lz4 : build macro LZ4_NBWORKERS_MAX removed ; worker threads of frame and legacy
formats are capped by LZ4F_getMaxNbWorkers(), 1 without liblz4 multi-threading
(restores a cap for the legacy format on POSIX). lz4 -V reports "multithread"
only when both lz4 and liblz4 support it ; -T# warning and -v note accordingly.
VS2022 _test.bat checks the version line, catching a CLI built without LZ4F_MULTITHREAD
(same output, so no other observable difference).
frameMT : validateMaxNbWorkers ; test builds use LZ4F_NBWORKERS_MAX=128.
2026-10-22 12:58:19 -07:00

68 lines
2.2 KiB
C

/*
LZ4conf.h - compile-time parameters
Copyright (c) Yann Collet. All rights reserved.
GPL v2 License
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You can contact the author at :
- LZ4 source repository : https://github.com/lz4/lz4
- LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c
*/
#ifndef LZ4CONF_H_32432
#define LZ4CONF_H_32432
/* Default compression level.
* Can be overridden by environment variable LZ4_CLEVEL.
* Is overridden at runtime by command -# */
#ifndef LZ4_CLEVEL_DEFAULT
# define LZ4_CLEVEL_DEFAULT 1
#endif
/* Determines if multithreading is enabled or not
* Default: enabled on Windows, disabled on other platforms */
#ifndef LZ4IO_MULTITHREAD
# ifdef _WIN32
/* Windows supports Completion Ports */
# define LZ4IO_MULTITHREAD 1
# else
/* Requires <pthread> support.
* Can't be reliably and portably tested at source code level
* so must be set a build level */
# define LZ4IO_MULTITHREAD 0
# endif
#endif
/* Determines default nb of threads for compression
* Default value is 0, which means "auto" :
* nb of threads is determined from detected local cpu.
* Can be overridden by Environment Variable LZ4_NBWORKERS.
* Can be overridden at runtime using -T# command */
#ifndef LZ4_NBWORKERS_DEFAULT
# define LZ4_NBWORKERS_DEFAULT 0
#endif
/* Determines default lz4 block size when none provided.
* Default value is 7, which represents 4 MB.
* Can be overridden at runtime using -B# command */
#ifndef LZ4_BLOCKSIZEID_DEFAULT
# define LZ4_BLOCKSIZEID_DEFAULT 7
#endif
#endif /* LZ4CONF_H_32432 */