我可以在程序中更改堆栈大小限制吗? [英] Can I change the stack size limits from within the program?

查看:146
本文介绍了我可以在程序中更改堆栈大小限制吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过传递 + RTS -Kn 来配置GHC编译好的Haskell程序的最大堆栈大小,其中 n

有没有办法在程序中改变这个设置?



(我想测试各种函数的堆栈消耗,并因此尝试运行它的各种限制,捕获 StackOverflow 异常。)

解决方案

时间回答了这个问题:No


I can configure the maximum stack size of a GHC compiled Haskell program by passing +RTS -Kn to it, where n is some number.

Is there a way to change this setting from within the program?

(I’d like to benchmark stack consumption of various functions, and hence try to run it with various limits, catching the StackOverflow exception.)

解决方案

Time has answered this with: „No"

这篇关于我可以在程序中更改堆栈大小限制吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆