delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/20/09:21:36

Message-ID: <33D210A6.5EDF@lr.net>
Date: Sun, 20 Jul 1997 09:20:38 -0400
From: Isaac Waldron <waldroni AT lr DOT net>
Reply-To: waldroni AT lr DOT net
Organization: The Computer Nerd
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Allocation of memory.

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.

Any help would be appreciated.

-- 
-Begin Signature-
Isaac Waldron <waldroni AT lr DOT net> N1YZI
http://www.geocities.com/SiliconValley/Lakes/5703/home.html
-End Signature-

- Raw text -


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