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

Feature Request: Support Rc, Arc and other smart pointer types #5

Open
ZhennanWu opened this issue Jan 20, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@ZhennanWu
Copy link

Currently this crate only generate thin Box pointers, it would be great if it also supports other std smart pointer types. Additional attributes can be introduced to flag the generation of those pointers on demand.

Does this feature fit with this crate's future goal list?

Finally, thank you for your marvellous work on this crate!

@ZhennanWu ZhennanWu added the enhancement New feature or request label Jan 20, 2022
@kotauskas
Copy link
Owner

I've had some thoughts about this feature as well, but the problem with it is that it requires implementing Rc/Arc with either a support crate (macro in thin_trait_object-macros, support code in thin_trait_object), or by macro-pasting the exact same Rc/Arc code for all TTOs (which is a direct path to adverse code bloat). Either way, substantial duplication of std functionality occurs.

My idea of resolving this issue was to release a separate crate that implements Rc and Arc in an ABI-stable and transparent fashion, then use that as infrastructure for reference-counting shared-ownership TTOs in thin_trait_object. As I'm working on polishing and cleaning up another crate of mine, interprocess, I'm not actively working on that endeavor. Once that's done though, I'll be sure revisit this topic.

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

No branches or pull requests

2 participants