Closed Arakula closed 3 years ago
Makes sense. I wrapped the input handling in a loop: https://github.com/Ableton/link/commit/c05a176cbe6c865f925f944c2dc497734431498c
Just out of curiosity, are you running Link on a platform where this is actually a problem?
Me? No. I'm working on Windows, and it would presumably require days of constant space bar mistreatment to come close to a point where the memory usage difference would become visible. I'm just carefully examining the LinkHut example as it seems to be the best documentation available.
The thread function
void input(State& state)
ends with a call toinput(state);
. This means that whenever a key is pressed, another call address (plus some local variables) is needlessly pushed onto the stack. While this should not be a big problem on today's machines (unless you let a rabid monkey hammer on the keyboard), it would definitely be better to enclose the logic in input() in ado { ... } while(true);
loop instead.