Re: [PATCH v10 4/5] rust: add find_bit_benchmark_rust module.

From: Miguel Ojeda
Date: Mon Jun 02 2025 - 11:00:06 EST


On Mon, Jun 2, 2025 at 4:32 PM Yury Norov <yury.norov@xxxxxxxxx> wrote:
>
> > +const BITMAP_LEN: usize = 4096 * 8 * 10;
> > +// Reciprocal of the fraction of bits that are set in sparse bitmap.
> > +const SPARSENESS: usize = 500;
>
> Is there any simple mechanism to keep C and rust sizes synced? (If no,
> not a big deal to redefine them.)

One may pick them from C (possibly with a `RUST_HELPER_*` if needed).
If they are non-trivial macros, then using an `enum` instead of a
`#define` on the C side is also an alternative.

> What is the name policy for rust? Maybe a more human-readable name
> would work better here?

Up to the maintainers, and generally the same as for C. In the global
Rust samples and things like that we have `rust` in the name since
they are Rust samples after all, but there is no need to say `rust` or
`module` in actual modules etc. unless there is a reason for it.

I hope that helps!

Cheers,
Miguel