Open ghost opened 1 year ago
Large static arrays, produce huge executables, I always allocate dynamicaly. You will always have problems with that, as they have to bi initialized in any language compiler, even assembler.
What is the code that produces this?
@gingerBill The problem seems to just be that I have a very large array literal using a slice type (citiesList := []City { // info here }
). I had already posted this github issue before remembering that I had this. Anyways, I would probably expect the compiler to just error out on array literals that are too big to compile instead of freezing the system. Although, the previous version of Odin was actually able to compile the program. It's not a huge issue as I intended to replace this large array with something else anyways (parsing from the file and appending to an array is way too slow with the amount of information the program needs, so it will have to be something else other than that).
@bmaxa Thanks. Yeah, I am actually aware of the issues with large static arrays, but sometimes I just want to get things done quickly, especially when testing or prototyping something.
You could use #load
to embed it and then @(init)
to initialize that cities list on startup.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
odin report
output:Current Behavior
I have a very large array in my program that used to compile, but no longer does.
When compiling, my computer almost completely freezes. The mouse is hardly movable and extremely choppy, freezing frequently for a couple of seconds at a time, sound of music playing starts cutting out a bit, and everything slows down dramatically. If I wait long enough, I get this error: