2 ms·
1)There is sometimes a very slight performance hit as there is more space between arrays and you miss on cache 2)using something which is smaller than MAX_SIZE
by bluecalm 11y ago
1)There is sometimes a very slight performance hit as there is more space between arrays and you miss on cache
2)using something which is smaller than MAX_SIZE is never worse unless you write some safety critical software where a bug when you write to unintended but empty location is better than writing randomly somewhere and/or crashing. I prefer the latter in what I am doing (as it's easier to find something is very wrong)
- Peaker 11y agoThe memory hit is an interesting point, could be useful if there's a static validation on worst case stack size. The smaller allocation is worse as it hides potential bugs.