home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3717 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.3 KB  |  40 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!usc!sdd.hp.com!elroy.jpl.nasa.gov!nntp-server.caltech.edu!gah
  3. From: gah@hood.hood.caltech.edu (Glen Herrmannsfeldt)
  4. Subject: stack size
  5. Message-ID: <gah.711830283@oldhood>
  6. Summary: how big a stack can, and should, one have?
  7. Keywords: stack
  8. Sender: news@cco.caltech.edu
  9. Nntp-Posting-Host: oldhood.hood.caltech.edu
  10. Organization: California Institute of Technology, Pasadena
  11. Date: Wed, 22 Jul 1992 18:38:03 GMT
  12. Lines: 26
  13.  
  14. link386 seems to have a 2k default stack.
  15.  
  16. I just finished a series of bug reports to bug-gcc that I finally
  17. decided were due to too small a stack.  I call to getchar() would
  18. write over parts of program memory.
  19.  
  20.  
  21. Then I tried different stack sizes with link386.
  22.  
  23. 4k, 256k, 4MB, 64MB, 1GB, 256MB.
  24.  
  25. Up to 64MB ran fine, fast, etc.  Apparently it does not need to 
  26. allocate the whole thing in real or swap space.
  27.  
  28. At 1GB it refused to load.
  29.  
  30. At 256MB it got an internal processing error, which, if I figure out
  31. how, I will report to IBM.  (Any one from IBM?  How do I do this?)
  32.  
  33. It seems that there is little penalty for a big stack, and a large
  34. penalty (clobbered memory) for a small stack.  Why not have a big default
  35. stack?
  36.  
  37. Has anyone else experienced any of this?
  38.  
  39. Remember, a call to getchar() and nothing else will overflow a 2K stack!
  40.