mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-16 07:46:27 -04:00
parent
de2f1a4568
commit
e4971b4187
@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#include <folly/container/EvictingCacheMap.h>
|
#include <folly/container/EvictingCacheMap.h>
|
||||||
#include <folly/container/F14Map.h>
|
#include <folly/container/F14Map.h>
|
||||||
|
#include <folly/system/HardwareConcurrency.h>
|
||||||
#include <folly/system/ThreadName.h>
|
#include <folly/system/ThreadName.h>
|
||||||
|
|
||||||
#include "dwarfs/block_cache.h"
|
#include "dwarfs/block_cache.h"
|
||||||
@ -232,11 +233,11 @@ class block_cache_ final : public block_cache::impl {
|
|||||||
, LOG_PROXY_INIT(lgr)
|
, LOG_PROXY_INIT(lgr)
|
||||||
, options_(options) {
|
, options_(options) {
|
||||||
if (options.init_workers) {
|
if (options.init_workers) {
|
||||||
wg_ = worker_group("blkcache",
|
wg_ =
|
||||||
std::max(options.num_workers > 0
|
worker_group("blkcache", std::max(options.num_workers > 0
|
||||||
? options.num_workers
|
? options.num_workers
|
||||||
: std::thread::hardware_concurrency(),
|
: folly::hardware_concurrency(),
|
||||||
static_cast<size_t>(1)));
|
static_cast<size_t>(1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <folly/FileUtil.h>
|
#include <folly/FileUtil.h>
|
||||||
#include <folly/String.h>
|
#include <folly/String.h>
|
||||||
#include <folly/json.h>
|
#include <folly/json.h>
|
||||||
|
#include <folly/system/HardwareConcurrency.h>
|
||||||
|
|
||||||
#include "dwarfs/error.h"
|
#include "dwarfs/error.h"
|
||||||
#include "dwarfs/filesystem_v2.h"
|
#include "dwarfs/filesystem_v2.h"
|
||||||
@ -42,7 +43,7 @@ namespace dwarfs {
|
|||||||
namespace po = boost::program_options;
|
namespace po = boost::program_options;
|
||||||
|
|
||||||
int dwarfsck(int argc, char** argv) {
|
int dwarfsck(int argc, char** argv) {
|
||||||
const size_t num_cpu = std::max(std::thread::hardware_concurrency(), 1u);
|
const size_t num_cpu = std::max(folly::hardware_concurrency(), 1u);
|
||||||
|
|
||||||
std::string log_level, input, export_metadata, image_offset;
|
std::string log_level, input, export_metadata, image_offset;
|
||||||
size_t num_workers;
|
size_t num_workers;
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include <folly/Conv.h>
|
#include <folly/Conv.h>
|
||||||
#include <folly/FileUtil.h>
|
#include <folly/FileUtil.h>
|
||||||
#include <folly/gen/String.h>
|
#include <folly/gen/String.h>
|
||||||
|
#include <folly/system/HardwareConcurrency.h>
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
@ -368,7 +369,7 @@ constexpr unsigned default_level = 7;
|
|||||||
int mkdwarfs(int argc, char** argv) {
|
int mkdwarfs(int argc, char** argv) {
|
||||||
using namespace folly::gen;
|
using namespace folly::gen;
|
||||||
|
|
||||||
const size_t num_cpu = std::max(std::thread::hardware_concurrency(), 1u);
|
const size_t num_cpu = std::max(folly::hardware_concurrency(), 1u);
|
||||||
|
|
||||||
block_manager::config cfg;
|
block_manager::config cfg;
|
||||||
std::string path, output, memory_limit, script_arg, compression, header,
|
std::string path, output, memory_limit, script_arg, compression, header,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user