From 0e2d7955e5e04240dcb526cd69f7ae8b8331bac1 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 22 Oct 1999 09:06:51 +0000 Subject: [PATCH] 19991022-10:53 GMT+1 --- harbour/ChangeLog | 9 +++++++++ harbour/include/extend.h | 1 + harbour/source/rtl/fm.c | 11 ++++++++--- harbour/source/vm/hvm.c | 4 ++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d01159c418..3739110bd9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,12 @@ +19991022-10:53 GMT+1 Victor Szel + * source/vm/hvm.c + + //INFO now displays Clipper-like memory info. + Just the values are higher ;) + * source/rtl/fm.c + include/extend.h + + MEMORY() functionality split into Harbour and C callable functions. + hb_xquery() + 19991022-10:41 GMT+1 Victor Szel * source/rtl/fm.c tests/memory.prg diff --git a/harbour/include/extend.h b/harbour/include/extend.h index bcf2603c2a..dddb56a01d 100644 --- a/harbour/include/extend.h +++ b/harbour/include/extend.h @@ -283,6 +283,7 @@ extern void * hb_xgrab( ULONG ulSize ); /* allocates memory, e extern void hb_xfree( void * pMem ); /* frees memory */ extern void * hb_xrealloc( void * pMem, ULONG ulSize ); /* reallocates memory */ extern ULONG hb_xsize( void * pMem ); /* returns the size of an allocated memory block */ +extern ULONG hb_xquery( USHORT uiMode ); /* Query different types of memory information */ #if UINT_MAX == ULONG_MAX /* NOTE: memcpy/memset can work with ULONG data blocks */ diff --git a/harbour/source/rtl/fm.c b/harbour/source/rtl/fm.c index e06a6f3f99..6824d0ef11 100644 --- a/harbour/source/rtl/fm.c +++ b/harbour/source/rtl/fm.c @@ -42,6 +42,7 @@ * hb_xmemset() * * Copyright 1999 Victor Szel + * hb_xquery() * HB_MEMORY() * * See doc/license.txt for licensing terms. @@ -281,9 +282,8 @@ void * hb_xmemset( void * pDestArg, int iFill, ULONG ulLen ) #endif -HARBOUR HB_MEMORY( void ) +ULONG hb_xquery( USHORT uiMode ) { - USHORT uiMode = hb_parni( 1 ); ULONG ulResult; /* TODO: Return the correct values instead of 9999 [vszel] */ @@ -410,6 +410,11 @@ HARBOUR HB_MEMORY( void ) ulResult = 0; } - hb_retnl( ulResult ); + return ulResult; +} + +HARBOUR HB_MEMORY( void ) +{ + hb_retnl( hb_xquery( hb_parni( 1 ) ) ); } diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 087cc29ba5..0ee7a390ac 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -260,9 +260,13 @@ void hb_vmInit( void ) if( hb_cmdargCheck( "INFO" ) ) { char * pszVersion = hb_version( 1 ); + char buffer[ 128 ]; hb_outerr( pszVersion, 0 ); hb_outerr( hb_consoleGetNewLine(), 0 ); + sprintf( buffer, "DS avail=%luKB OS avail=%luKB EMM avail=%luKB", hb_xquery( 1 ), hb_xquery( 3 ), hb_xquery( 4 ) ); + hb_outerr( buffer, 0 ); + hb_outerr( hb_consoleGetNewLine(), 0 ); hb_xfree( pszVersion ); }