| ▲ | Neywiny 4 hours ago | |
But it puts sizeable arrays on the stack. That's not really better since instead of an out of memory exception it'll just corrupt the stack of on the majority of embedded implementations that don't have hardware stack protection in use or available. | ||
| ▲ | magicalhippo an hour ago | parent | next [-] | |
So I think they're correctly saying this is non-allocating, since it doesn't internally malloc, but I also think you're right to criticize their stack spam. I think it would be better if they made you pass a struct with those arrays and such as members, then you get to chose if you want to put it in global memory to ensure they're available or if you take your chance on a local stack instance. | ||
| ▲ | 4 hours ago | parent | prev [-] | |
| [deleted] | ||