4 ms·
With a flexible array member, updating the length in-place is rather infrequent, at least in certain use cases (given that to expand it you might have to reallo
by dzaima 2y ago
With a flexible array member, updating the length in-place is rather infrequent, at least in certain use cases (given that to expand it you might have to reallocate the entire struct, including the count field).
What it helps with is fortified builds, as now the compiler/libc can now get an upper bound on the intended size, whereas before it's had to just assume flexible array members are infinitely-long and thus is largely never able to add bounds checking.