Jump to content
Fivewin Brasil

Memory - Memória do Hardware.


kapiaba

Recommended Posts

Galera ajuda ahi, em uma máquina com um pente de memoria de 4 Gb


As funções abaixo me retorna os valores 3 e 2 não entendi.



#include "FiveWin.ch"

FUNCTION Main()

// Este me retorna 3 é o que tem livre?
MsgInfo( Int( nExtMem() / ( 1024 * 1024 * 1024 ) ) + 1, " Memory: " )

// Este me retorna 2 e este?
MsgInfo( Int( nAvailMem() / ( 1024 * 1024 * 1024 ) ) + 1, " Memory: " )

RETURN NIL

#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>

HB_FUNC( NEXTMEM ) // --> nHardwareMemory - Retorna 3
{
MEMORYSTATUSEX mst;

memset( &mst, 0, sizeof( MEMORYSTATUSEX ) );
mst.dwLength = sizeof( MEMORYSTATUSEX );

GlobalMemoryStatusEx( &mst );

hb_retnll( mst.ullTotalPhys );
}

HB_FUNC( NAVAILMEM ) // --> nHardwareMemory - retorna 2
{
MEMORYSTATUSEX mst;

memset( &mst, 0, sizeof( MEMORYSTATUSEX ) );
mst.dwLength = sizeof( MEMORYSTATUSEX );

GlobalMemoryStatusEx( &mst );

hb_retnll( mst.ullAvailPhys );
}
#pragma ENDDUMP


Obg. abs.

Link to comment
Share on other sites

Grande João,

Olha testei aqui e achei que o Primeiro nExtMen é a memoria total ou seja 4 - 1 para vídeo sobra +- 3 utilizável

o Outro nAvailMen parece ser a disponível ou em cache no momento varia um pouco.

teria que ver em outras maquinas com memorias diferentes.

? Int(nExtMem())/1000000000

?Int(nAvailMem())/1000000000

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...