delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/27/06:32:59

From: dan AT phascolarctid DOT rebellion DOT co DOT uk (Daniel J Mitchell)
Newsgroups: comp.os.msdos.djgpp,comp.os.msdos.programmer
Subject: DPMI call 0x50b -- get memory info
Date: Mon, 26 May 1997 22:00:07 GMT
Organization: Ye 'Ol Disorganized NNTPCache groupie
Message-ID: <slrn5ok1vk.ok9.dan@phascolarctid.rebellion.co.uk>
NNTP-Posting-Host: rebelhq.demon.co.uk
Cache-Post-Path: phascolarctid.rebellion.co.uk!dan AT phascolarctid DOT rebellion DOT co DOT uk
Lines: 34
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

 Is this actually implemented in any DPMI host currently available, or
am I just doing something hideously wrong?

 I've got code of the form

__dpmi_memory_info buffer;
__dpmi_get_memory_information(&buffer);

 According to DJGPP's dpmi.h, this should then fill in that structure with
all sorts of useful information. Instead, I get basically junk; some of
the numbers look as if they might be right, but I also get 0, -1, 1, etc,
bytes as the amount allocated, which is definitely wrong.


 Does CWSDPMIv3 implement this? (if so, I can't find it anywhere in the
source, but I may just have missed it, of course). What about a Win95
DOS box? Tran's pmode?

 Before I tear my hair out completely, it would be nice to know if I'm 
barking up completely the wrong tree here.


 Alternatively, is there a better way to get memory usage information? I'm
looking for something from the memory manager, so I can tell the amount of
physical / virtual memory, to work out just why I get all this swapping..

 (I suppose I could just wrap malloc() / free() in something to count 
allocations, but that's rather too horrible for words..)


 Thanks,

 -- dan

- Raw text -


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