▲ | Out_of_Characte 3 days ago | |||||||
Because arrays simply do not deal with fragmentation. Yes, you could probaly get decent performance on a modern system that has memory overcommit strategy where you could allocate sparse adress ranges where you would probaly never run out of pointers unless you actually write to your variable array. But its just kind of mediocre and you're better off actually dealing with the stack if you can actually deal with certain fixed sizes. | ||||||||
▲ | konstantinua00 3 days ago | parent [-] | |||||||
...what are you talking about? array-like storage with dynamic size has existed since forever - it's vector. over or undercommitting is a solved problem VLA is the way to bring that into type system, so that it can be it's own variable or struct member, with compiler auto-magic-ing size reading to access members after it | ||||||||
|