Re: [PATCH 5/6] gpu: nova-core: add NVKV typed decoding

From: Danilo Krummrich

Date: Wed Aug 19 2026 - 15:03:05 EST


On Mon Aug 17, 2026 at 2:56 PM CEST, Eliot Courtney wrote:
> +/// A fixed capacity vector that holds at most `N` elements.
> +#[derive(Debug, Copy, Clone, PartialEq, Eq, Zeroable)]
> +pub(crate) struct ArrayVec<T, const N: usize> {
> + data: [T; N],

This should be [MaybeUninit<T>; N].

> + len: usize,
> +}

Let's move this into the alloc module.

> +impl<T: Default + Copy, const N: usize> Default for ArrayVec<T, N> {
> + fn default() -> Self {
> + Self {
> + data: [T::default(); N],
> + len: 0,
> + }
> + }
> +}

For anything that actually constructs an ArrayVec we should probably consider to
restrict its size with a const_assert!()?

For an initializer approach that'd be not an issue of course.

fn init_with<E>(f: impl FnOnce(&mut Self) -> Result<(), E>) -> impl Init<Self, E>