#sparse array of optionals
1 messages · Page 1 of 1 (latest)
const vectors = blk: {
var array = std.mem.zeroes([N]?*const fn () void);
array[29] = some_handler;
break :blk array;
};
although this seems like an XY problem
sorry, what's that?
an XY problem is asking about your attempted solution rather than potentially the real problem. For a crude example: "how do I implement a garbage collector" when you really only need defer free() in one instance.
well, i don't see other solutions because it's a hardware thing
is it a case of memory mapped IO, IDT, or like JIT?
IDT ig, not 100% sure, it's for interrupt vector
makes sense, something like the comptime array may work then. Although it could also be initialized at runtime