From de9b370b149369fe688599519ea7f749e9e45f9c Mon Sep 17 00:00:00 2001 From: Florian Schmaus <flow@cs.fau.de> Date: Fri, 25 Feb 2022 12:51:29 +0100 Subject: [PATCH] Fix MEMORY_MANAGER_VICTIM_PERCENTAGE The calculation was previously done using integers, this lead to MEMORY_MANAGER_VICTIM_PERCENTAGE to become 0. --- emper/Emper.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emper/Emper.hpp b/emper/Emper.hpp index 44d14867..e1b86ddb 100644 --- a/emper/Emper.hpp +++ b/emper/Emper.hpp @@ -291,7 +291,8 @@ const bool CONTEXT_MANAGER_WITH_MEMORY_MANAGER = #endif ; -constexpr float MEMORY_MANAGER_VICTIM_PERCENTAGE = EMPER_MEMORY_MANAGER_VICTIM_PERCENTAGE / 100; +constexpr float MEMORY_MANAGER_VICTIM_PERCENTAGE = + static_cast<float>(EMPER_MEMORY_MANAGER_VICTIM_PERCENTAGE) / 100; static_assert(MEMORY_MANAGER_VICTIM_PERCENTAGE >= 0 && MEMORY_MANAGER_VICTIM_PERCENTAGE <= 1); const size_t ASSUME_PAGE_SIZE = EMPER_ASSUME_PAGE_SIZE; -- GitLab