flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > [request]Default Stack Size for PE |
Author |
|
Maverick 06 Jul 2007, 06:55
The best thing you can do is to keep it to 4KB in the PE, and then handle it dynamically with your own code. Remember, though, to set FS:4 and FS:8 to the correct value (or set it to the $00000000..$7FFFFFFF extremes and forget) otherwise your ESP will be checked in most Win32 functions and your thread will be terminated by the OS (should it lay outside the FS:4..FS:8 boundaries).
For my programming style, I tend to use the stack a lot, and the heap as little as possible. Allocating memory on the stack, when you use the technique above, is just using [ESP-xxxxx] straight. Superfast allocation, and no need to free anything. Also, you don't have to probe for stack pages, etc.. like the usual stack Win32 programming style. |
|||
06 Jul 2007, 06:55 |
|
f0dder 06 Jul 2007, 11:47
Just remember to allocate memory for your new manual stack
|
|||
06 Jul 2007, 11:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.