Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Crash when AI allocates too much memory #7513
Version of OpenTTD
crash with a dump/not crash
OpenTTD closes itself without a dump.
Steps to reproduce
Configure one NoCAB v499 to start.
Squirrel is a bit annoying in that it doesn't allow using a stateful per-VM memory allocator. You can add some logic to the allocator functions to keep track of the total allocation size of all Squirrel VMs, but that won't help limiting each AI or GS, or detect which one is having the biggest impact.
I explored letting it use a stateful allocator (e.g. arena allocator) and it will involve touching lots of Squirrel internals.
Using recursion for GC marking is problematic even if the total memory allocation is limited.