doc_DATA =
lib_LTLIBRARIES = liblzma.la
-liblzma_la_SOURCES = $(top_srcdir)/src/common/tuklib_physmem.c
+liblzma_la_SOURCES =
liblzma_la_CPPFLAGS = \
-I$(top_srcdir)/src/liblzma/api \
-I$(top_srcdir)/src/liblzma/common \
-Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma.map
endif
+liblzma_la_SOURCES += $(top_srcdir)/src/common/tuklib_physmem.c
+
+if COND_THREADS
+liblzma_la_SOURCES += $(top_srcdir)/src/common/tuklib_cpucores.c
+endif
+
include $(srcdir)/common/Makefile.inc
include $(srcdir)/check/Makefile.inc
* of RAM on the specific operating system.
*/
extern LZMA_API(uint64_t) lzma_physmem(void) lzma_nothrow;
+
+
+/**
+ * \brief Get the number of processor cores or threads
+ *
+ * This function may be useful when determining how many threads to use.
+ * If the hardware supports more than one thread per CPU core, the number
+ * of hardware threads is returned if that information is available.
+ *
+ * \brief On success, the number of available CPU threads or cores is
+ * returned. If this information isn't available or an error
+ * occurs, zero is returned.
+ */
+extern LZMA_API(uint32_t) lzma_cputhreads(void) lzma_nothrow;
if COND_THREADS
liblzma_la_SOURCES += \
+ common/hardware_cputhreads.c \
common/outqueue.c \
common/outqueue.h \
common/stream_encoder_mt.c
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+//
+/// \file hardware_cputhreads.c
+/// \brief Get the number of CPU threads or cores
+//
+// Author: Lasse Collin
+//
+// This file has been put into the public domain.
+// You can do whatever you want with this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include "common.h"
+
+#include "tuklib_cpucores.h"
+
+
+extern LZMA_API(uint32_t)
+lzma_cputhreads(void)
+{
+ return tuklib_cpucores();
+}
XZ_5.1.3alpha {
global:
lzma_block_uncomp_encode;
+ lzma_cputhreads;
lzma_get_progress;
lzma_stream_encoder_mt;
lzma_stream_encoder_mt_memusage;