Add GNATCOLL.Refcount.Limited_Shared_Pointers.#107
Add GNATCOLL.Refcount.Limited_Shared_Pointers.#107liampwll wants to merge 1 commit intoAdaCore:masterfrom
Conversation
This is a copy of Shared_Pointers except Set takes an anonymous function pointer instead of a value directly. This allows for the generic element type to be a limited type.
|
It might make sense to have |
|
Hi @liampwll, thanks for your contribution! The current PR duplicates too much code to remain maintainable. Your suggestion of having Could you also add tests to your PR, especially one that attempts to copy a limited version of the shared element? As for the inlining performance issue, we can run benchmarks afterwards. If that may help you, here is the main I used to test your MR: |
|
Hi, I currently have a Problem also requiring a "Limited Holder" for my solution i used something like: A litle more flexible version might be something like this: Both of these aproches offer the additional benefit of initializing the element with some data. |
I'm not really sure what you mean by this. The approaches above feel like an extra level of OO that might fit in to the style of a specific project but don't have any universal benefit, so it seems like it would be better for them to be implemented by a given user of GNATCOLL while leaving the underlying implementation as simple as possible. |
|
It appears that tasks stored in limited records in these don't start under some circumstances. I wasn't able to figure out the exact circumstances, setting this as a draft until I do. |
This is a copy of Shared_Pointers except Set takes an anonymous function pointer instead of a value directly. This allows for the generic element type to be a limited type.