8000 emp::array uses dynamically allocated memory under the hood · Issue #408 · devosoft/Empirical · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
emp::array uses dynamically allocated memory under the hood #408
Open
@mmore500

Description

@mmore500

Describe the bug
A clear and concise description of what the bug is.

emp::array uses std::vector as a backend. For single process jobs, this works fine. For multiprocessing jobs, this creates an issue when passing arrays in messages between processes. Messages will contain pointers to data that allocated on one process that another processes doesn't have.

To my knowledge, there isn't a fundamental reason emp::array is implemented using std::vector. Looking into a quick patch, I found that working with std::vector is more convenient because its iterator is a proper class and therefore you can inherit from it. std::array's iterator is /not/ a class -- it's just a pointer so you can't inherit from it. But with a little elbow grease we should be able to switch out emp::array's backend to be std::array instead. Perhaps @mercere99 can weigh in on this assessment?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0