Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we be using cxx-rs shared_ptr instead of unique_ptr? #126

Open
bschwind opened this issue Aug 23, 2023 · 0 comments
Open

Should we be using cxx-rs shared_ptr instead of unique_ptr? #126

bschwind opened this issue Aug 23, 2023 · 0 comments

Comments

@bschwind
Copy link
Owner

This is more of an open question. Right now the higher level abstractions use a UniquePtr to hold a reference to the inner FFI types for opencascade.

This works, but then it becomes harder to clone and use shapes in multiple contexts. I'm not sure yet if we desire that functionality, but maybe shared_ptr makes more sense for holding those FFI pointers.

I can imagine scenarios where we'd want to store references to intermediate shapes that are created, perhaps stored in multiple parts of the model code that get referenced later when building new shapes on top of them. shared_ptr might be better suited to a scenario like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant