Re: [PATCH] Rust: Implement a unique reference type URef supplementing ARef

From: Oliver Mangold
Date: Fri Feb 28 2025 - 06:32:15 EST


On 250228 1210, Andreas Hindborg wrote:

Hi Andreas,

> Wrap at 75 characters please :)

> See `AlwaysRefCounted` for reference on formatting.

> Please use back ticks for types: [`ARef`], [`URref`]

> For your next version, can you run `make rustfmt`?:

Sorry for all that. Apparently I need to get used a bit more to how things
are supposed to be done here. Please be patient with me for a bit :)

> When the trait is unsafe, we need to specify the conditions under which
> it is safe to implement:

Of course. Sorry, missed that.

> I would prefer `UniqueRef`. I know `ARef` has a different naming scheme,
> but I think `UniqueRef` is sufficiently short and significantly more
> descriptive than `URef`.

Ok, will do. Honestly I also prefer UniqueRef.

> Also it would be great if you include your "rust: for fix dec_ref for
> URef<Request>" folded in.

Are your sure? Wouldn't the patches have to be ordered like this?

this patch (mine)
rust: block: change `queue_rq` request type to unique (yours)
rust: block: simplify reference counting scheme (yours)
rust: for fix dec_ref for URef<Request> (mine)

IOW, the latter requests depends on the 2 patches of yours, while these depend on this patch. You know what I mean?

Best regards,

Oliver