From: Martin Str|mberg Subject: Re: memory allocation: program stall. Newsgroups: comp.os.msdos.djgpp References: User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (NetBSD/1.5_BETA (alpha)) Message-ID: <1026914776.633337@queeg.ludd.luth.se> Cache-Post-Path: queeg.ludd.luth.se!unknown AT speedy DOT ludd DOT luth DOT se X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Date: 17 Jul 2002 14:06:16 GMT Lines: 41 NNTP-Posting-Date: 17 Jul 2002 14:06:16 GMT NNTP-Posting-Host: queeg.ludd.luth.se X-Trace: 1026914776 news.luth.se 464 130.240.16.109 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Patrick Chen wrote: : I am using Rhide IDE and having problem allocating memory. The graphic : display program involve the following segment which I suspect could be the : problem. : The program run ok just once, then after exit with return 0 from main(good : status), it couldn't be executed a second time from Rhide. The Rhide get : hanged, mouse cannot activate any menu command at all. Have to quit Rhide : and run the program again. Sometimes the error bin/ld.exe cannot find : svga02.exe appear and need to restart the computer again. Even the : free(offscreen) at the end does not make a difference. Sounds like 1. Really bad bug in your program or perhaps 2. If you're using WNT, W2k or WXP, this could be a problem with RHIDE. The solution to 1 is running in plain DOZE and you'll probably get a lot of crashes that WINDOZE is designed to ignore. The solution to 2 (from my perspective) is that you state which WINDOZE version you're using. : Hope some of you can help in solving this. Is this a legal operation for : 640*480 size? : byte *offscreen; : offscreen= (byte*)malloc((640*480)*sizeof(byte)); : .. : .. : free(offscreen) Stricly speaking, without knowing what kind of type byte is, we can't tell. _If_ it's (unsigned) short, that would be right, I think. Right, MartinS