Oops... I think you should use `var parameter` in that `converter`, or it might 
be considered unsafe to take the address, especially with an old version of the 
compiler.
    
    
    converter toAddr[I; T](a: var array[I, T]): ptr T
    
    
    Run

I mean, it's always unsafe to do, but Nim 1.6 or earlier will refuse to compile 
if trying to take the address of a non-var parameter. Sorry for forgetting 
about that.

As for the `static` keyword, it tells the compiler to resolve the expression at 
the compile-time. In this case it should copy at the compile-time and not at 
the runtime. If the array is just used as global variable, it's probably fine. 
But if used as a local variable or an argument, it can still be pushed (and 
copied) onto the stack and thus cause the stack to overflow, but I'm not sure.

Reply via email to