mirror of
https://github.com/ceph/ceph
synced 2025-01-01 08:32:24 +00:00
src/msg/dpdk: reserve funcs capacity to avoid reallocation
When a new vector is added larger than then current vector capacity, it reallocates space. lamda function accesses the previous adress will cause a segment fault. Therefore, reserve sufficient funcs space to avoid reallocation. Fixes: https://tracker.ceph.com/issues/52907 Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
This commit is contained in:
parent
86ec66a9b5
commit
f696c365a2
@ -254,8 +254,9 @@ class DPDKStack : public NetworkStack {
|
||||
}
|
||||
|
||||
public:
|
||||
explicit DPDKStack(CephContext *cct): NetworkStack(cct)
|
||||
{}
|
||||
explicit DPDKStack(CephContext *cct): NetworkStack(cct) {
|
||||
funcs.reserve(cct->_conf->ms_async_op_threads);
|
||||
}
|
||||
virtual bool support_local_listen_table() const override { return true; }
|
||||
|
||||
virtual void spawn_worker(std::function<void ()> &&func) override;
|
||||
|
Loading…
Reference in New Issue
Block a user