Open camilchp opened 1 year ago
That is a big array to be on the stack. I'm experiencing the same problem with a smaller one though (80Kb).
I'm not sure if lazy_static boxes the value but before that I think it creates it on the stack, and it makes copies of it.
Agreed, such a big array on the stack may not be ideal. But the fact that it works without lazy_static and fails with it makes it a bug, regardless.
The following code generates a stack overflow, despite containing no explicitly recursive code.
playground link On my laptop, the stack overflow occurs in Debug mode, but not in Release mode.
On the playground, on the other hand, I get a stack overflow in both modes.
The problem only occurs when
u_gen
is called inlazy_static
. When calling it directly (see commented line inmain
), everything goes fine.cc @pchampin