summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-06-29 21:46:42 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-29 21:47:20 +0200
commit8d0cc3adc5d2516d407acafccf366e3d7139d542 (patch)
treeb11478b55a6c37fa5a96ab6f192241d20d5e9529 /Kernel
parent2665cdf2a1b0759a7afc8fbecc07b9e30d30be57 (diff)
downloadserenity-8d0cc3adc5d2516d407acafccf366e3d7139d542.zip
Kernel: Don't create a JsonArray when generating /proc/cpuinfo
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/GlobalProcessExposed.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/Kernel/GlobalProcessExposed.cpp b/Kernel/GlobalProcessExposed.cpp
index f8f06af79c..4f76959a81 100644
--- a/Kernel/GlobalProcessExposed.cpp
+++ b/Kernel/GlobalProcessExposed.cpp
@@ -4,10 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-#include <AK/JsonArraySerializer.h>
-#include <AK/JsonObject.h>
#include <AK/JsonObjectSerializer.h>
-#include <AK/JsonValue.h>
#include <AK/UBSanitizer.h>
#include <Kernel/Arch/x86/CPU.h>
#include <Kernel/Arch/x86/InterruptDisabler.h>
@@ -521,13 +518,15 @@ private:
[&](Processor& proc) {
auto& info = proc.info();
auto obj = array.add_object();
- JsonArray features;
- for (auto& feature : info.features().split(' '))
- features.append(feature);
obj.add("processor", proc.get_id());
obj.add("cpuid", info.cpuid());
obj.add("family", info.display_family());
- obj.add("features", features);
+
+ auto features_array = obj.add_array("features");
+ for (auto& feature : info.features().split(' '))
+ features_array.add(feature);
+ features_array.finish();
+
obj.add("model", info.display_model());
obj.add("stepping", info.stepping());
obj.add("type", info.type());