Re: [PATCH v6 03/14] rust: sync: add `Arc::as_ptr`
From: Andreas Hindborg
Date: Tue Feb 04 2025 - 04:57:19 EST
"Tamir Duberstein" <tamird@xxxxxxxxx> writes:
> On Thu, Jan 16, 2025 at 2:23 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>>
>> "Tamir Duberstein" <tamird@xxxxxxxxx> writes:
>>
>> > On Fri, Jan 10, 2025 at 3:19 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>> >>
>> >> Add a method to get a pointer to the data contained in an `Arc`.
>> >>
>> >> Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
>> >
>> > Can this mention why it is needed?
>>
>> I can add that after the cut. It is for impleminting `HrTimerPointer`
>> for `Arc`.
>
> The broader question is: why do we need to implement `/HrTimerPointer
> ` for `Arc`? Even broader is: why do we need to use raw pointers so
> much?
The C APIs work with raw pointers. One important detail here is that the
consumers of the Rust APIs will never work with raw pointers. That is
all encapsulated within the abstractions.
Best regards,
Andreas Hindborg