www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/26/22:54:02

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Sorting algorithms
Date: Wed, 26 Feb 1997 21:57:35 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 36
Message-ID: <3315224F.6E3C@cs.com>
References: <Pine DOT SUN DOT 3 DOT 95 DOT 970226145420 DOT 697A-200000 AT s5u DOT eecs DOT uic DOT edu>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp202.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Andrew Deren wrote:
> 
> I hope someone can help me with this. I am supposed to write a program
> that counts the times it takes for the selection sort and merge sort and
> compare them. I got the program working but somehow when I get to 14000
> elements I get the error. Can someone tell me what am I doing wrong?

Without even looking at your program, the likeliest culprit is that
you're running out of memory handles in the CWSDPMI DPMI host.  This is
a well-known "problem" with the host, because it only allocates enough
internal heap to handle a certain number of memory requests.  The
workaround, however, is extremely simple:  make sure that you have the
latest version of cwsdpmi (v3), and then run the 'cwsparam' program from
the DJGPP bin directory.  It will give you a list of modifiable settings
- what you need to do is increase the maximum heap size that cwsdpmi
allocates.  For precise information on what the heap does, read the
'cwsparam.doc' file, but you should be able to fix your problem by
simply doubling (or tripling) the heap value.

The only disadvantage to this workaround is that it makes cwsdpmi take
up slightly more conventional memory when it is resident.  This isn't a
major problem of course, but you should be wary of it.

Note that I haven't tried to test your program for bugginess.  If this
doesn't solve your problem, then post the code again and I'll take a
more detailed look at it.

hth!

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |        fighteer AT cs DOT com         |
| "Starting flamewars since 1993"  |   http://www.cs.com/fighteer   |
|  *** NOTICE ***  This .signature is generated randomly.           |
|                  If you don't like it, sue my computer.           |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019