lichao
2021-03-25 a76a94009d78a6a41654335dcb9202fb31659de0
src/shm.h
@@ -54,6 +54,11 @@
    {}
    std::string name() const { return name_; }
    bool Remove() { return Remove(name()); }
    void *Alloc(const size_t size) { return allocate(size, std::nothrow); }
    void Dealloc(void *p) { if(p) { deallocate(p); } }
    template<class T> void Dealloc(offset_ptr<T> ptr) { return Dealloc(ptr.get()); }
    template <class T, class ...Params> T * New(Params const&...params) { return construct<T>(anonymous_instance, std::nothrow)(params...); }
    template <class T> void Delete(T *p) { if (p) { destroy_ptr<T>(p); }; }
    template <class T> void Delete(offset_ptr<T> p) { Delete(p.get()); }
@@ -75,7 +80,7 @@
    bool IsOk() const { return pdata_; }
protected:
    ShmType &shm() { return shm_; }
    ShmType &shm() const { return shm_; }
public:
    template <class...Params>
    ShmObject(ShmType &segment, const std::string &name, Params&&...t):