delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/04/20/21:27:02

Message-ID: <353BF5F3.1C81@cs.com>
Date: Mon, 20 Apr 1998 21:27:15 -0400
From: "John M. Aldrich" <fighteer AT cs DOT com>
Organization: Two pounds of chaos and a pinch of salt.
MIME-Version: 1.0
To: Nate Eldredge <nate AT cartsys DOT com>
CC: DJ Delorie <dj AT delorie DOT com>, eliz AT is DOT elta DOT co DOT il, djgpp-workers AT delorie DOT com
Subject: Re: Available memory
References: <19980421011110 DOT AAA9311 AT ppp124 DOT cartsys DOT com>

Nate Eldredge wrote:
> 
> Unfortunately, due to the wonderful and inspired structure of C
> preprocessing, you can't. Something like this:
> 
> #define coreleft #error Die, Borland luser!
> 
> would just expand into something like this:
> 
> bytes_free = #error Die, Borland luser!();

How about:

#define coreleft \
#error Die, Borland luser!

Would that not work?

> But, according to Borland's docs, as far as I can see, `coreleft' is only
> documented as telling how much memory is not in use. It does not guarantee
> that one can actually allocate that much. Therefore, since its intended use
> is only as a statistic, I don't see an actual problem with just returning
> the meaningless statistics given by the DPMI functions.

Okay, that's fine with me.  I don't see how it can hurt anything, except
that users will come whining instead that they can't allocate as much
memory as coreleft() claims they can.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "A committee is a life form with six |
|       aka Fighteer I       | or more legs and no brain."          |
|   mailto:fighteer AT cs DOT com   |                                      |
| http://www.cs.com/fighteer |                 - Lazarus Long       |
---------------------------------------------------------------------

- Raw text -


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