Skip to content
Prev Previous commit
Next Next commit
undo (long long) cast in GetMemoryStatus
  • Loading branch information
mangod9 committed Oct 20, 2022
commit 71a58961901ebd2ad42568c06fc87f98639825eb
3 changes: 1 addition & 2 deletions src/coreclr/gc/env/gcenv.os.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,7 @@ class GCToOSInterface
// available_page_file - The maximum amount of memory the current process can commit, in bytes.
// Remarks:
// Any parameter can be null.
// explicit (unsigned long long) is used to conform to both Linux and MacOS
static void GetMemoryStatus(unsigned long long restricted_limit, uint32_t* memory_load, unsigned long long* available_physical, unsigned long long* available_page_file);
static void GetMemoryStatus(uint64_t restricted_limit, uint32_t* memory_load, uint64_t* available_physical, uint64_t* available_page_file);

// Get size of an OS memory page
static size_t GetPageSize();
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25888,7 +25888,7 @@ void gc_heap::get_memory_info (uint32_t* memory_load,
uint64_t* available_physical,
uint64_t* available_page_file)
{
GCToOSInterface::GetMemoryStatus(is_restricted_physical_mem ? total_physical_mem : 0, memory_load, (unsigned long long*) available_physical, (unsigned long long*) available_page_file);
GCToOSInterface::GetMemoryStatus(is_restricted_physical_mem ? total_physical_mem : 0, memory_load, available_physical, available_page_file);
}

//returns TRUE is an overflow happened.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/gc/unix/gcenv.unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ uint64_t GetAvailablePageFile()
// that is in use (0 indicates no memory use and 100 indicates full memory use).
// available_physical - The amount of physical memory currently available, in bytes.
// available_page_file - The maximum amount of memory the current process can commit, in bytes.
void GCToOSInterface::GetMemoryStatus(unsigned long long restricted_limit, uint32_t* memory_load, unsigned long long* available_physical, unsigned long long* available_page_file)
void GCToOSInterface::GetMemoryStatus(uint64_t restricted_limit, uint32_t* memory_load, uint64_t* available_physical, uint64_t* available_page_file)
{
uint64_t available = 0;
uint32_t load = 0;
Expand Down