Skip to content

Removed large stack-overflowing VLAs from the code.

Matthieu Schaller requested to merge vla_ban into master

This fixes one issue identified in @jwillis' large FOF runs.

We overflow the stack in proxy.c when the number of top-level cells (per dimension) is >100. Replacing the VLAs by malloced arrays on the heap solves the problem.

I have checked all other VLAs in the code (thanks to GCC's -Wvla) and they are all small allocations that will not grow to unreasonable sizes until we have ~1 million MPI ranks or 1 million queues. At which point, we have other things to worry about. Keeping these as VLAs is faster. No blanket ban on VLAs then.

Merge request reports