weixin_39732534
weixin_39732534
2020-12-02 04:43

Memory Allocation

I've seen that for the creation of the Entities when parsing the ifc file you use a function EntityFactory:createEntityObject that return a lambda with a new call. After, you assign a returned pointer to a std::shared_ptr. When tou do so, a double allocation is made, one for the entity by the new call, and one for a control block. Reading large ifc files this is time consuming. If you use std::make_shared, only one allocation is made.

Thanks

该提问来源于开源项目:ifcquery/ifcplusplus

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

8条回答

为你推荐

换一换