#Preferred type of run-time allocated comptime-known length array

1 messages · Page 1 of 1 (latest)

fresh aspen
#

Would you recommend having a

arr: *[1 << comp_len]u32,

or simply making it a slice

arr: []u32,

even though you know its length at comptime.

toxic stirrup
#

pointers to arrays are designed to act like slices in most circumstances, but take up half the space