Date: Mon, 21 Jul 1997 09:56:20 -0400 (EDT) From: "Art S. Kagel" To: Isaac Waldron Cc: djgpp AT delorie DOT com Subject: Re: Allocation of memory. In-Reply-To: <33D210A6.5EDF@lr.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sun, 20 Jul 1997, Isaac Waldron wrote: > Please Help. > > I am trying to dynamically allocate memory for a buffer. I wrote a > header file that loads and displays pcx files. I need to use a buffer > for the decompressed image. > > I'm using code like this: > > unsigned char *imagebuffer; > imagebuffer = (unsigned char *)malloc(bufsize); > if (imagebuffer == NULL) > { > `error_handler(NOT_ENOUGH_MEM); > } > > It always exits with a "Not enough memory" error. The obvious questions we need th answers to to help are: 1) What is the value of bufsize? Type? 2) How much physical RAM do you have on your machine? 3) How much free disk space on the drive designated for DPMI swap? 4) What is your DPMI host/server (CWSDPMI/WIN31/WIN95/WINNT/QDPMI/...)? 5) How much swap (Virtual Memory) is your DPMI host configured for? Art S. Kagel, kagel AT bloomberg DOT com