-------------------------------------------- On Thu, 7/25/13, Kevan Hashemi hashemi@brandeis.edu wrote:
Subject: Minimum Stack Size To: "gpc@gnu.de" gpc@gnu.de Date: Thursday, July 25, 2013, 4:47 PM
Dear GPC Users,
I'm trying to force the operating system to give my Pascal code a 2-MByte stack so I can solve a problem with a recursive routine. I have tried:
const {for recursive routines} minstacksize: cardinal = 2000000; attribute (name = '_stklen');
But that does not appear to work. Perhaps I am not trying hard enough. Am I on the right track?
Yours, Kevan
-- Kevan Hashemi, Electrical Engineer Physics Department, Brandeis University http://alignment.hep.brandeis.edu/
What you describe doing, I found in a FAQ, but the paragraphs around it mentioned DJGPP. I'm not clear on what DJGPP is, or whether you're using it. (I think I'm not using it -- I'm using MinGW.)
The same place mentions using a program named "stubedit" to set the stack size: stubedit your_app.exe minstack=5000K Do you have a "stubedit"?
In doc/gpc/gpcc.txt there's mention of an option (switch?): Stack size: -$M<StackSize>
"ld" has an option: --stack <size> I think you can get that through to "ld" by putting -Xlinker --stack=2000000 on your "gpc" command.
I don't see "stklen" in my map file, but I wonder whether you need more or fewer underscores. (Maybe "attribute(name=) used to "help" you by prepending an underscore, but has since been changed to do exactly what you tell it to do.)
I haven't tried any of these things.