flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 19 Feb 2005, 15:23
http://flatassembler.net/docs.php?article=manual#2.4.2:
Quote: stack directive sets up the size of stack for Portable Executable, value of stack reserve size should follow, optionally value of stack commit separated with comma can follow. When stack is not defined, it's set by default to size of 4096 bytes. |
|||
![]() |
|
mindflyr 19 Feb 2005, 16:16
Thank you, Privalov. From your newest programmer, mindflyr.
|
|||
![]() |
|
MCD 21 Feb 2005, 10:33
I was wondering that if you want to use compiled HTML Help on Win98 (some ActiveX stuff), your program must have at least 64Kb of stack to lunch the help, even if the program actually only needs 1Kb. A terrible waste of stack.
The hell knows what they wanna store in there. Perhaps some nice pics ![]() |
|||
![]() |
|
calm_observer 21 Feb 2005, 17:23
MCD wrote: I was wondering that if you want to use compiled HTML Help on Win98 (some ActiveX stuff), your program must have at least 64Kb of stack to lunch the help, even if the program actually only needs 1Kb. A terrible waste of stack. One of the reasons windos requires alot of stack space is because the winproc preceedures are reentrable and each time you reenter you recreate all of your local variables. Also the stack space, I believe, is reserved not committed so you while you use up virtual address space you may not use up physical ram. _________________ EDUCATION, n. That which discloses to the wise and disguises from the foolish their lack of understanding. |
|||
![]() |
|
JohnFound 21 Feb 2005, 17:43
calm_observer wrote: One of the reasons windos requires alot of stack space is because the winproc preceedures are reentrable and each time you reenter you recreate all of your local variables. Yes, all this is true, but it can not be the case. The stack in Win32 should grow automatically when the program needs more stack space. So, in principle you can begin with 4k stack and leave to Windows to allocate as big stack as application needs. The only problem with this schema is that the application must allocates at once maximum of 4kbytes stack memory (i.e. the next stack access must be less than 4kbytes above the current address in esp. Maybe WinHlp (or whatever is the name of HTML-help engine) allocates at once more than 4k and thus broke the stack. Definately this is a bug and shame on MS - it is still not fixed. BTW: this also means that if your application uses some bigger amount of the stack, (in normal manner) even 64k can be not enough. Hm: what about if we prepare the stack not as a initial PE stack, but immediately before calling HTML-help functions. This can be done with simple loop from $00 to $0f that decrease esp by $1000 and read one byte from the stack (mov eax, [esp]) - thus forcing Windows to allocate the memory. Regards. |
|||
![]() |
|
calm_observer 21 Feb 2005, 19:19
JohnFound wrote: ...Yes, all this is true, but it can not be the case. The stack in Win32 should grow automatically when the program needs more stack space... Now that you mention it I do recall reading this somewhere. JohnFound wrote: Hm: what about if we prepare the stack not as a initial PE stack, but immediately before calling HTML-help functions. This can be done with simple loop from $00 to $0f that decrease esp by $1000 and read one byte from the stack (mov eax, [esp]) - thus forcing Windows to allocate the memory. Win32Forth ttp://win32forth.sourceforge.net/ in fact does something like this, however I had assumed it was to make sure that the memory was actually committed, but after your explaination I think it was more in line with your explaination. BTW I'm going to download Fresh and give it a go ![]() _________________ EDUCATION, n. That which discloses to the wise and disguises from the foolish their lack of understanding. |
|||
![]() |
|
calm_observer 21 Feb 2005, 19:38
|
|||
![]() |
|
JohnFound 21 Feb 2005, 20:35
calm_observer wrote: BTW I'm going to download Fresh and give it a go Any opinion is welcome. ![]() |
|||
![]() |
|
f0dder 23 Feb 2005, 12:46
Quote:
It's not a bug, it's an inherent property of using guard pages for growing the stack. If you have >4k local variables, you need to do stack probing - the HLL's I've seen does this automatically. I do wonder what the problem with HtmlHelp is. RichEdit also needs a big initial stack. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.