dongyuans61046 2014-01-16 18:24
浏览 12
已采纳

为Go 1.2增加StackMin

Basically I have the same problem with Go 1.2 as described here:

https://groups.google.com/forum/#!topic/golang-nuts/TYai0DVoYwg

Is there a way of increasing StackMin for my Go program without recompiling Go?

  • 写回答

1条回答 默认 最新

  • duancaozen6066 2014-01-16 18:41
    关注

    StackMin is compiled into the runtime, so you can't change it without recompiling Go. You can find the constants here: http://golang.org/src/pkg/runtime/stack.h#L72

    If you're unable to recompile Go, you can try to work around the hot split problem by artificially increasing the amount of stack space used by your program (i.e. insert var foo [2<<10]byte into your code before the hot-split function calls) - but this could be hit-or-miss, and may need to be re-tuned as your program changes.

    As Dmitry mentioned, Go 1.3 is planned to have contiguous stacks (not a linked list of stack segments) which get reallocated and copied to as needed. https://docs.google.com/document/d/1wAaf1rYoM4S4gtnPh0zOlGzWtrZFQ5suE8qr2sD8uWQ/pub

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?