The best way for this feature is to add a new code to the VM. No chances.
Woops, yes, I meant to say alloca.
@Varriount, why is _calloc_ not portable? It just allocates zeroed memory. By
any chance did you mean to say _alloca_ , the non-standard routine that
allocates memory on the stack?
> If you really need to know the number of processors on a system, you could
> always compile a sub-program during compile-time and invoke it.
Indeed I assumed that. But I have no idea how to do it in detail in a user
friendly way -- so that user can still do a plain "nimble install myTool". Not
If you _really_ need to know the number of processors on a system, you could
always compile a sub-program during compile-time and invoke it.
Regarding allocating arrays at runtime, is there a reason that a
[sequence](https://nim-lang.org/docs/manual.html#types-array-and-sequence-types)
won't wo
There is UncheckedArray[T]
@Vantage Yeah, I just realized now that you mentioned it.
@Stefan Yes, in my case, it is exactly like that. Have staging server which
similar with production server.
* * *
Let me change question a bit, is there any example to make array during runtime?
Ad Vantage: Sure, but when we ship software as source code then computer
compiling the code is often the same computer running the executable, or at
least a very similar device, so it makes some sense.
Even if this worked it would only have the processors of the computer
compiling. not the computer running your program.
This code failed with error message `Cannot 'importc' at compile time`
import cpuinfo
var arr: array[countProcessors(), int]
Is there a way to get the processors count that will be used for creating an
array?
10 matches
Mail list logo