mirror of
https://github.com/ceph/ceph
synced 2025-03-20 09:16:59 +00:00
Merge pull request #20640 from tchaikov/wip-async-dpdk-temp-str
msg/async: avoid referencing the temporary string Reviewed-by: Haomai Wang <haomai@xsky.com>
This commit is contained in:
commit
e1c23cde27
@ -40,7 +40,7 @@ namespace dpdk {
|
||||
std::condition_variable eal::cond;
|
||||
std::list<std::function<void()>> eal::funcs;
|
||||
|
||||
static int bitcount(unsigned n)
|
||||
static int bitcount(unsigned long long n)
|
||||
{
|
||||
return std::bitset<CHAR_BIT * sizeof(n)>{n}.count();
|
||||
}
|
||||
@ -52,8 +52,8 @@ namespace dpdk {
|
||||
}
|
||||
|
||||
bool done = false;
|
||||
const char *hexstring = c->_conf->get_val<std::string>("ms_dpdk_coremask").c_str();
|
||||
int num = (int)strtol(hexstring, NULL, 0);
|
||||
auto num = std::stoull(c->_conf->get_val<std::string>("ms_dpdk_coremask"),
|
||||
nullptr, 16);
|
||||
unsigned int coremaskbit = bitcount(num);
|
||||
|
||||
ceph_assert(coremaskbit > c->_conf->ms_async_op_threads);
|
||||
|
Loading…
Reference in New Issue
Block a user