cocalele / PureFlash

A ServerSAN storage system designed for flash device
GNU General Public License v3.0
97 stars 29 forks source link

use std::shared_ptr to manager PfDispatcher/PfReplicator/PfFlashStore #58

Closed ericqzhao closed 6 months ago

qiyuanzhi commented 6 months ago

将这三种指针修改为shared_ptr 的目的是什么? @ericqzhao

cocalele commented 6 months ago

没有必要进行这样的修改。dispatcher,replicator,replicator的生命周期都是永久的,一旦创建就不会删除。没必要使用智能指针管理。相反,智能指针在访问时多一层C++的封装,对性能会带来损失。

ericqzhao commented 6 months ago

new PfFlashStore 没看到那里释放?

qiyuanzhi commented 6 months ago

new PfFlashStore 没看到那里释放?

当前不会被释放,会一直运行到程序结束