Oh. So your exception is complaining about the class HashForgetfulChain, which you haven’t shown here. Is that in a DLL you’ve imported? Is it a Native or Managed plugin? Or, where is the HashForgetfulChain class?
Can you show a line of code that’s calling or trying to use the HashForgetfulChain struct? I don’t know much of anything about unsafe code, and I understand that nested classes/structs can be public even if the outer class is private, but maybe see if making ChainClass public changes the behavior?
I just tried out this code to see what was going on, and got the same error. Look carefully at the error and you should hopefully see the issue:
It seems that trying to initialize banks_ to contain so many elements (about 1.5 million) causes the error. Changing banks_[1524288]; to banks_[10];, for example, caused the code to run without issue.
So you’d have to decide whether that array really needs to be so large, or whether it’ll work fine with a small size.
This error really explains what the problem is in the size of the structure and not in something else. I will try to do something with this. Thanks for the help!