On Thursday, 31 March 2022 at 19:44:23 UTC, WhatMeWorry wrote:
Is there a way to programmatically determine the exact maximum memory size available to the DRuntime’s array implementation?

Closest you can get is probably [`GC.stats`][1], which will give you the total amount of free memory available to the GC.

If what you actually want to do is attempt to grow an array without crashing if there isn't enough memory, you can use [`GC.extend`][2]. There's an example in the linked documentation that shows how to do it.

[1]: https://druntime.dpldocs.info/core.memory.GC.stats.html
[2]: https://druntime.dpldocs.info/core.memory.GC.extend.html

Reply via email to