www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/04/11:41:35

From: pajonk AT ajax DOT umcs DOT lublin DOT pl (Grzegorz Ludorowski)
Newsgroups: comp.os.msdos.djgpp
Subject: how to free memory?
Date: 4 Jan 1997 15:20:46 GMT
Lines: 22
Message-ID: <5alsge$fj0$1@helios.man.lublin.pl>
NNTP-Posting-Host: ajax.umcs.lublin.pl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi!

I've got a problem with "free" (or "xfree") routines - it's silly I know,
but they seems not to work...
I tried program listed below, and after freeing that "dummy" pointer,
free memory doesn't change... If anybody coud test it and help.

#include <stdio.h>
#include <dpmi.h>
#include <crt0.h>

int *dummy;

void main () {
         printf ("At start:                   physical mem %d   virtual mem %d\n",_go32_dpmi_remaining_physical_memory (),_go32_dpmi_remaining_virtual_memory ());
         dummy = (int*) malloc (100000);
         printf ("After allocating 100kbytes: physical mem %d   virtual mem %d\n",_go32_dpmi_remaining_physical_memory (),_go32_dpmi_remaining_virtual_memory ());
         free (dummy);
         printf ("After releasing 100kbytes:  physical mem %d   virtual mem %d\n",_go32_dpmi_remaining_physical_memory (),_go32_dpmi_remaining_virtual_memory ());
}
Grzegorz "LUDO" Ludorowski
http://ajax.umcs.lublin.pl/~pajonk

- Raw text -


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