4 ms·
If by string you mean array of char then it's perfectly possible to stack allocate an array of char in C#. http://msdn.microsoft.com/en-us/library/aa664785(v=v
by fleitz 13y ago
If by string you mean array of char then it's perfectly possible to stack allocate an array of char in C#.
http://msdn.microsoft.com/en-us/library/aa664785(v=vs.71).aspx http://msdn.microsoft.com/en-us/library/aa664785(v=vs.71).as...
And seriously, it's not like everything in the linux kernel is stack allocated. The stack runs out of memory as well so it's not as if stack allocation is some magical place with out resource constraints. Since we deal with processors with caches and lots of other variable timing issues you don't even really get deterministic timing either.
- MichaelGG 13y agoNo, I mean to allocate a System.String instance that you can pass to other functions. Or a managed array (say, the char array you pass to String.Split). Or any other reference type.
- kibwen 13y ago> The stack runs out of memory as well I agree with the rest of what you're saying, but I want to point out that Rust stacks are growable (at least in theory), so you won't run out of stack until you're OOM.