Skip to content

Commit 2eb8448

Browse files
committed
Change memory color formula. Rename static init constant.
1 parent f4c36df commit 2eb8448

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

SerialPrograms/Source/CommonFramework/VideoPipeline/Stats/MemoryUtilizationStats.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void MemoryUtilizationStats::update(){
3535
memory.total_system_memory,
3636
memory.total_used_system_memory
3737
)){
38-
uint64_t free_memory = memory.process_physical_memory - memory.process_virtual_memory;
38+
uint64_t free_memory = memory.total_system_memory - memory.total_used_system_memory;
3939

4040
if (usage >= 0.90 || free_memory < 2*GB){
4141
system.color = COLOR_RED;

SerialPrograms/Source/Controllers/ControllerDescriptor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace PokemonAutomation{
2121
//
2222
// Here we store a map of all controller types in the program.
2323
//
24-
static std::map<ControllerInterface, std::unique_ptr<InterfaceType>>& all_controller_interfaces(){
24+
static std::map<ControllerInterface, std::unique_ptr<InterfaceType>>& ALL_CONTROLLER_INTERFACES(){
2525
static std::map<ControllerInterface, std::unique_ptr<InterfaceType>> instance;
2626
return instance;
2727
}
@@ -31,7 +31,7 @@ void InterfaceType::register_factory(
3131
ControllerInterface controller_interface,
3232
std::unique_ptr<InterfaceType> factory
3333
){
34-
auto ret = all_controller_interfaces().emplace(controller_interface, std::move(factory));
34+
auto ret = ALL_CONTROLLER_INTERFACES().emplace(controller_interface, std::move(factory));
3535
if (!ret.second){
3636
throw InternalProgramError(
3737
nullptr, PA_CURRENT_FUNCTION,
@@ -79,7 +79,7 @@ void ControllerOption::load_json(const JsonValue& json){
7979
break;
8080
}
8181

82-
for (const auto& item : all_controller_interfaces()){
82+
for (const auto& item : ALL_CONTROLLER_INTERFACES()){
8383
const JsonValue* params = obj->get_value(CONTROLLER_INTERFACE_STRINGS.get_string(item.first));
8484
if (params == nullptr){
8585
continue;

0 commit comments

Comments
 (0)