home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18831 < prev    next >
Encoding:
Text File  |  1992-11-23  |  1.4 KB  |  36 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!sokoloff
  3. From: sokoloff@athena.mit.edu (James T Sokoloff)
  4. Subject: Re: Specifying stack size in Think C 5.03?
  5. Message-ID: <1992Nov23.185045.4945@athena.mit.edu>
  6. Sender: news@athena.mit.edu (News system)
  7. Nntp-Posting-Host: w20-575-40.mit.edu
  8. Organization: Massachusetts Institute of Technology
  9. References: <z5nqw7+@lynx.unm.edu>
  10. Distribution: usa
  11. Date: Mon, 23 Nov 1992 18:50:45 GMT
  12. Lines: 22
  13.  
  14. In article <z5nqw7+@lynx.unm.edu> espen@leo.unm.edu (Peter Espen) writes:
  15. >    I am using Think C 5.03 to run some generic C programs using the
  16. >console window and the ccommand() function. The programs that I am running
  17. >are not that large, but they do have functions that are highly recursive.
  18. >I find myself running out of memory when the recursion starts getting pretty
  19. >deep.  Is there a way in Think C 5.03 to specify the size of the stack??
  20. >
  21. >    Peter Espen
  22. >    espen@leo.unm.edu
  23. >
  24. I'm not sure if this is the correct way to do it.  (Higher net.gods should
  25. correct me if I'm wrong.)  In your main(), do the following:
  26.  
  27. SetApplLimit( GetApplLimit() - 32768L);
  28.  
  29. This should "reserve" 32K more for the stack, at expense of the max heap
  30. size.
  31.  
  32. I believe it should be called before: MaxApplZoom( certainly!) and I think
  33. before toolbox Init & MoreMasters()...  But I'm not a net.god...
  34.  
  35. ---Jim Sokoloff
  36.