From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Various Questions for DJGPP Date: Sat, 02 May 1998 13:29:46 -0400 Organization: Two pounds of chaos and a pinch of salt. Lines: 87 Message-ID: <354B580A.5AB0@cs.com> References: <354B062D DOT 670 AT primenet DOT com> NNTP-Posting-Host: ppp135.cs.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Al Wong wrote: > > In all situations below, I'm using just DOS 6.22 without > Windows 3.11 running. HIMEM and EMM386 loaded. Using SMARTDRV. > I've also increased the DJGPP stack size to 29K (using STUBEDIT.EXE) 29K? I seriously hope that's not what you did, because that is far too little for most programs. The default stack size for all DJGPP progs is 256K, but the C++ compiler (and occasionally the linker) may require more in pathological cases. Most users report that 768K or 1 MB is enough. Also, this must be done individually for each program that requires it. Reference: FAQ chapter 15.9. > and the heap size to 40K (using CWSPARAM.EXE): Careful; making the heap size too large wastes conventional memory. If you have any problems running multiple nested programs (make, for example), try reducing this value. > 1) A large C program compiles and links successfully on a > Pentium 133Mhz with 40MB of RAM. The same program also > compiles but FAILS to link on a 486-33Mhz with 8 MB of RAM. > I get a SIGSEGV error. Possible solutions and fixes suggested > in the FAQ doesn't seem relevant to this problem. Does the current > version of DJGPP require "better" hardware than a 486? > (BTW, the 486 has a disk cache set to 2MB). > Would like suggestions about finding a solution for this. > I'm not sure how to decode the SIGSEGV error so any > help on that would be appreciated. Thanks. If the SIGSEGV occurs during linking, please capture the output of "gcc -v ..." using the 'redir' utility that comes with DJGPP (FAQ chapters 6.10 & 6.12). This capture should include the crash traceback, which may be useful in debugging the problem. DJGPP should run without problems on 386 and above architectures as long as there is sufficient virtual memory. > 2) How does one disable the "Time in ..." messages that the > compiler displays. I'm sure they are valuable for profiling > and optimization but I would just like to see any warning > or error messages without undue scrolling. "Time in..."? I don't know what that message is; I've never seen it when I compile. Could you post a capture (as above) that shows the messages? > 3) How does one check for "memory leaks". It seems there is no > exact equivalent in DJGPP to coreleft() or farcoreleft(). > I sure would like to know if memory allocations are being > released. There is no standard or easy way to reliably check free memory in protected mode. It's simply a feature of the way virtual memory is handled and cannot be worked around without a great deal of effort. The best way to debug memory leaks is to create wrapper functions for malloc() and free() which track the total number/size of requests/frees. Then you can print that data out at the end of your program. There are a couple of debugging libraries available that help with this task. See all of FAQ chapter 15 for issues related to memory management. > 4) To get rid of all debugger information, is using the "-s" switch > in the compilation all that is needed? Yes. This, of course, prevents you from being able to debug, so I don't recommend it unless you have a completed program to release. > Thanks for your help in advance. I also plan on writing a review > about my experience with DJGPP and RHIDE on a web page if anyone > is interested. Please post the URL when you're done so we can see it for ourselves. You're welcome! -- John M. Aldrich, aka Fighteer I UIN# 7406319 -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS d- s+:- a-->? C++>$ U@>++$ p>+ L>++ E>++ W++ N++ o+>++ K? w(---) O- M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+(++) tv+() b+++ DI++ D++ G>++ e(*)>++++ h!() !r !y+() ------END GEEK CODE BLOCK------