如何计算堆栈的剩余大小?

时间:2018-08-05 11:19:53

标签: c++ windows macos stack-overflow

我最近开始大量使用alloca,因为对于缓存而言,它是理想的选择。但是我的应用程序基于处理中等数据块(例如1024个浮点数)。尽管假设堆栈的大小为1MB,那么溢出的机会是最小的,但是仍然能够方便地确定是否有足够的空间并进行优化:

If there's enough space on stack => use stack
else => use dynamic allocation or some other resource

那么有没有一种跨平台的方法来确定堆栈的剩余大小?

0 个答案:

没有答案