Skip to content

Commit

Permalink
fixed bug type size allRAM, freeRAM reduction removed ~64GB max value…
Browse files Browse the repository at this point in the history
…, all memory available on my server
  • Loading branch information
GermanAizek committed Mar 4, 2024
1 parent 64ac468 commit 4510861
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Main_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3744,7 +3744,7 @@ void Main_Window::on_CH_Remove_RAM_Size_Limitation_stateChanged(int state)
Update_RAM_Size_ComboBox(32768);
}
else {
int allRAM = 0, freeRAM = 0;
size_t allRAM = 0, freeRAM = 0;
System_Info::Get_Free_Memory_Size(allRAM, freeRAM);

if (allRAM < ui.Memory_Size->value())
Expand All @@ -3760,7 +3760,7 @@ void Main_Window::on_CH_Remove_RAM_Size_Limitation_stateChanged(int state)

void Main_Window::on_TB_Update_Available_RAM_Size_clicked()
{
int allRAM = 0, freeRAM = 0;
size_t allRAM = 0, freeRAM = 0;
System_Info::Get_Free_Memory_Size(allRAM, freeRAM);
ui.TB_Update_Available_RAM_Size->setText(
tr("Free memory: %1 MB").arg(freeRAM));
Expand Down
2 changes: 1 addition & 1 deletion src/System_Info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2974,7 +2974,7 @@ bool System_Info::Update_Host_USB()
#include <tchar.h>
#include <windows.h>

void System_Info::Get_Free_Memory_Size(int& allRAM, int& freeRAM)
void System_Info::Get_Free_Memory_Size(size_t& allRAM, size_t& freeRAM)
{
MEMORYSTATUSEX mem;
mem.dwLength = sizeof(mem);
Expand Down
2 changes: 1 addition & 1 deletion src/System_Info.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class System_Info
static bool Delete_From_Used_USB_List( const VM_USB &device );
static bool Update_Host_USB();

static void Get_Free_Memory_Size( int &allRAM, int &freeRAM );
static void Get_Free_Memory_Size( size_t &allRAM, size_t &freeRAM );

static QStringList Get_Host_FDD_List();
static QStringList Get_Host_CDROM_List();
Expand Down
4 changes: 2 additions & 2 deletions src/VM_Wizard_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ void VM_Wizard_Window::on_CH_Remove_RAM_Size_Limitation_stateChanged(int state)
Update_RAM_Size_ComboBox(32768);
}
else {
int allRAM = 0, freeRAM = 0;
size_t allRAM = 0, freeRAM = 0;
System_Info::Get_Free_Memory_Size(allRAM, freeRAM);

if (allRAM < ui.Memory_Size->value())
Expand All @@ -761,7 +761,7 @@ void VM_Wizard_Window::on_CH_Remove_RAM_Size_Limitation_stateChanged(int state)

void VM_Wizard_Window::on_TB_Update_Available_RAM_Size_clicked()
{
int allRAM = 0, freeRAM = 0;
size_t allRAM = 0, freeRAM = 0;
System_Info::Get_Free_Memory_Size(allRAM, freeRAM);
ui.TB_Update_Available_RAM_Size->setText(
tr("Free memory: %1 MB").arg(freeRAM));
Expand Down

0 comments on commit 4510861

Please sign in to comment.