Fix: track "memory installed" for surveys less precisely (#10910)

It turns out, for Windows and Linux having the exact memory allows
for easy tracing of an individual. That is exactly against the idea
of the survey. And honestly, we don't need this precision.
This commit is contained in:
Patric Stout
2023-06-03 21:07:56 +02:00
committed by GitHub
parent 7d6aff3a34
commit 21adfa7567
4 changed files with 42 additions and 5 deletions

View File

@@ -16,9 +16,12 @@
#include <mach-o/arch.h>
#include <nlohmann/json.hpp>
#include <thread>
#include "../../safeguards.h"
extern std::string SurveyMemoryToText(uint64_t memory);
void SurveyOS(nlohmann::json &json)
{
int ver_maj, ver_min, ver_bug;
@@ -32,7 +35,8 @@ void SurveyOS(nlohmann::json &json)
json["min_ver"] = MAC_OS_X_VERSION_MIN_REQUIRED;
json["max_ver"] = MAC_OS_X_VERSION_MAX_ALLOWED;
json["memory"] = MacOSGetPhysicalMemory();
json["memory"] = SurveyMemoryToText(MacOSGetPhysicalMemory());
json["hardware_concurrency"] = std::thread::hardware_concurrency();
}
#endif /* WITH_NLOHMANN_JSON */