www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/12/19:15:25

From: "John M. Aldrich" <fighteer AT cs DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: malloc()...free()...WTF??
Date: Wed, 12 Aug 1998 19:06:49 -0400
Organization: Two pounds of chaos and a pinch of salt.
Lines: 18
Message-ID: <35D22009.1AA5FA0D@cs.net>
References: <6qr22o$rjn$1 AT birch DOT prod DOT itd DOT earthlink DOT net> <35D158A1 DOT 83BC6888 AT geocities DOT com>
NNTP-Posting-Host: ppp208.cs.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Merlin wrote:
> 
> When you declare a pointer....it doesn't use the 64k which is allocated for
> variables... so you have to call malloc or calloc to give it a size.. example:
> int  *a_ptr = (int *)malloc(64000)  //calloc(64000,1) can be used instead of malloc
> ok...this would make an array-like pointer with 64000 spaces...

Be careful, Merlin... the 64k barrier only exists in 16-bit, real-mode
compilers; for DJGPP and other 32-bit compilers, the only practical
limit is the amount of DPMI memory available.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | A singer in a smoky room / Smell of  |
|       aka Fighteer I       | wine and cheap perfume / For a smile |
|   mailto:fighteer AT cs DOT net   | they can share the night / It goes   |
| http://www.cs.net/fighteer/| on and on and on...                  |
---------------------------------------------------------------------

- Raw text -


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