@gsuberland whoa that's neat
Conversation
Notices
-
Embed this notice
✧✦Catherine✦✧ (whitequark@mastodon.social)'s status on Tuesday, 13-May-2025 08:57:53 JST ✧✦Catherine✦✧
-
Embed this notice
Graham Sutherland / Polynomial (gsuberland@chaos.social)'s status on Tuesday, 13-May-2025 08:57:54 JST Graham Sutherland / Polynomial
just realised you can do this in C#
const int MaxStackAlloc = 1024;
Span<int> indices = count <= MaxStackAlloc ? stackalloc int[count] : new int[count];so you dynamically get stack or heap allocation depending on the count.
-
Embed this notice