Add 1 more link re: allocation limits
parent
e9f19d0be6
commit
7bd68dd17b
|
@ -9,7 +9,7 @@ Under .NET 8:
|
||||||
- The largest 1D byte array is `new byte[Array.MaxLength]`, `Array.MaxLength` being hardcoded to `0x7FFFFFC7` or just under 2 GiB. (Would probably want to alloc in 1 GiB chunks to have nice code, maybe even smaller to keep the GC happy.)
|
- The largest 1D byte array is `new byte[Array.MaxLength]`, `Array.MaxLength` being hardcoded to `0x7FFFFFC7` or just under 2 GiB. (Would probably want to alloc in 1 GiB chunks to have nice code, maybe even smaller to keep the GC happy.)
|
||||||
- The largest 1D struct array is `new T[Array.MaxLength]`. So its size is... unbounded since structs don't have a size limit apart from the stack size (and `[InlineArray]`'s 1 MiB cap). (TODO check there isn't an undocumented cap)
|
- The largest 1D struct array is `new T[Array.MaxLength]`. So its size is... unbounded since structs don't have a size limit apart from the stack size (and `[InlineArray]`'s 1 MiB cap). (TODO check there isn't an undocumented cap)
|
||||||
- The largest *n*-D byte array is `UNK()` (`LongLength` is `0xUNK` or UNK GiB).
|
- The largest *n*-D byte array is `UNK()` (`LongLength` is `0xUNK` or UNK GiB).
|
||||||
- All of that is on the managed heap. The default/global stack is OS-specific and cannot be changed (feature request to come): On Windows, it's 1.5 MiB [due to an oversight](https://github.com/dotnet/runtime/issues/96347#issuecomment-1871528297), and on Linux, it's inherited from the OS, typically 8 MiB.
|
- All of that is on the managed heap. The default/global stack is OS-specific and cannot be changed (feature request to come): On Windows, it's 1.5 MiB [due to an oversight](https://github.com/dotnet/runtime/issues/96347#issuecomment-1871528297), and on Linux, it's inherited from the OS, [typically 8 MiB](https://github.com/dotnet/runtime/issues/33622#issuecomment-599462300).
|
||||||
- The stack size for threads can be [chosen at runtime](https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread.-ctor?view=net-8.0#system-threading-thread-ctor(system-threading-threadstart-system-int32)), though as with all of this you may have an XY problem and should reconsider.
|
- The stack size for threads can be [chosen at runtime](https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread.-ctor?view=net-8.0#system-threading-thread-ctor(system-threading-threadstart-system-int32)), though as with all of this you may have an XY problem and should reconsider.
|
||||||
|
|
||||||
Under Mono (x64 unless specified):
|
Under Mono (x64 unless specified):
|
||||||
|
|
Loading…
Reference in New Issue