delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/02/20:11:28

Date: Sun, 3 May 1998 10:08:28 +1000
Message-Id: <2.2.16.19980503100545.1da75fda@alphalink.com.au>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
From: aj <aj664 AT hotmail DOT com>
Subject: Q. dpmi_free_memory() under allegro.

help, i have a dpmi question.

i can run this program to display free memory and it works fine.

but when i include the same code into a much larger program, 
that also includes allegro, it crashs
is there something else im suppose to do before
calling the _dpmi_get..()

---------------------------------------------------------------------
#include <dpmi.h>
#include <stdio.h>
int main(void)
{
    __dpmi_free_mem_info *info;         // define pointer

    __dpmi_get_free_memory_information( info );                 // call to
get info
    
    printf("free mem = %d\n", info->largest_available_free_block_in_bytes);
// display

/*  the rest is the other fields of the structure.
 *   printf("maximum_locked_page_allocation_in_pages = %d\n",
info->maximum_locked_page_allocation_in_pages);
 *   printf("maximum_unlocked_page_allocation_in_pages = %d\n",
info->maximum_unlocked_page_allocation_in_pages);
 *   printf("size_of_paging_file_partition_in_pages = %d\n",
info->size_of_paging_file_partition_in_pages);
 *   printf("total_number_of_free_pages = %d\n",
info->total_number_of_free_pages);
 *   printf("total_number_of_physical_pages = %d\n",
info->total_number_of_physical_pages);
 *   printf("total_number_of_unlocked_pages = %d\n",
info->total_number_of_unlocked_pages);
 *   printf("free_linear_address_space_in_pages = %d\n",
info->free_linear_address_space_in_pages);
 *   printf("linear_address_space_size_in_pages = %d\n",
info->linear_address_space_size_in_pages);
 */   
}


-----------------------------------------
http://www.alphalink.com.au/~ibaxter/aj/

- Raw text -


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