如何让更多的内存,并避免对大量的递归的堆栈溢出? [英] How to allow more memory and avoid stack overflow on lots of recursion?

查看:454
本文介绍了如何让更多的内存,并避免对大量的递归的堆栈溢出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我测试的算法做大量递归调用的定时。我的程序死在128K左右递归调用,而这只需0.05秒。我希望让更多的内存有较长的时机在我的分析。我运行Linux和使用gcc。是否有一个系统调用,或环境变量,或GCC标志,或包装,还是什么?

I'm testing the timing of an algorithm that does lots of recursive calls. My program dies at about 128k recursive calls, and this takes only .05 seconds. I'd like to allow more memory to have longer timings in my analysis. I'm running linux and using gcc. Is there a system call, or environment variable, or gcc flag, or wrapper, or something?

推荐答案

有是Linux下的gcc没有堆栈大小编译器选项。然而本文讨论如何设置在Linux上的堆栈大小。中使用的ulimit 命令。

There is no stack size complier option for gcc under Linux. However this text discusses how to set the stack size on Linux. using the ulimit command.

这篇关于如何让更多的内存,并避免对大量的递归的堆栈溢出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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