-
April 6th, 2004, 06:36 AM
#1
about stack size
If my programm needs exact 600 bytes stack, can I just allocate 600 bytes for it? Will this causes stack overflow? Or some other problems?
Thank you in advance.
-
April 6th, 2004, 06:43 AM
#2
Either I am missing something here or I do not understood the problem...yes, you can allocate 600 bytes on the stack...without any problems...
-
April 6th, 2004, 06:45 AM
#3
Re: about stack size
Originally posted by wind0965
If my programm needs exact 600 bytes stack, can I just allocate 600 bytes for it? Will this causes stack overflow? Or some other problems?
Thank you in advance.
So what would happen if there are 601 bytes? Or for that matter 599 bytes? In other words, what exactly are you trying to accomplish?
Regards,
Paul McKenzie
-
April 6th, 2004, 07:13 AM
#4
I think wind0965 wants to adjust the stack space that windows allocates to fit exactly the 600 bytes to reduce memory waste..
maybe the /STACK compile option can help.
-
April 6th, 2004, 07:46 AM
#5
well, I don't know if it is necessary to reserve some more bytes for the interrupts or something else. The 600 bytes I mentioned is exactly my program itself needs.
-
April 7th, 2004, 04:28 PM
#6
Originally posted by wind0965
The 600 bytes I mentioned is exactly my program itself needs.
It is dangerous to assume that. For example, if the application gets an error, it could need more stack space and when it is not available, the application would crash in a manner that an application should never crash. You should endeavor to prevent crashes such as that, not cause them.
-
April 14th, 2004, 03:27 AM
#7
But how many more bytes of stack do I need for one application to avoid the crash? If there are some methods or mechanisms to estimate it?
Thank you for the reply.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|