January 15
On Sunday, 14 January 2024 at 19:53:21 UTC, Richard (Rikki) Andrew Cattermole wrote:
>
>> There is another way, though. In @system code, the gc delegate can be forcibly cast to be @nogc (as far as the type system is concerned - it doesn't change the behavior of the delegate).

yes, that way my idea too, but as tg pointed out to me, the @nogc function could store the delegate somewhere and another @nogc would then be able to access it.
you this only works if you can ensure nothing escapes the function.
January 18

On Sunday, 14 January 2024 at 13:32:14 UTC, Alexandru Ermicioi wrote:

>

On Sunday, 14 January 2024 at 12:32:26 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

But it is not a complete solution that is suitable for all scenarios.

This is not an either/or situation. We can have both solutions as different attributes.

Perhaps there should be a @trustedgc, similar to what@trusted is in safe system?
That would fix callback issue.

Best regards,
Alexandru.

I've wanted something like this for a while. An @IAcknowledgeTheGCMayBeUsedHere (brevify this). I experimented a bit (for fun) with making a locking GC that required deliberate unlocking prior to any attempt to allocate but solving the recursion problem made it stop being fun.

1 2 3 4
Next ›   Last »