summaryrefslogtreecommitdiff
path: root/Applications/SystemMonitor/MemoryStatsWidget.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-21 20:50:06 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-21 20:50:06 +0200
commit8d550c174edad68726b8e9c3cd5cd950bf1bf16a (patch)
tree2c6ed4bd36844e7df4bfc787ea6b23d71902f346 /Applications/SystemMonitor/MemoryStatsWidget.cpp
parent31b38ed88f3db123c498379f4615d2dce1ded406 (diff)
downloadserenity-8d550c174edad68726b8e9c3cd5cd950bf1bf16a.zip
LibCore: Convert CFile to ObjectPtr
Diffstat (limited to 'Applications/SystemMonitor/MemoryStatsWidget.cpp')
-rw-r--r--Applications/SystemMonitor/MemoryStatsWidget.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Applications/SystemMonitor/MemoryStatsWidget.cpp b/Applications/SystemMonitor/MemoryStatsWidget.cpp
index 889bea9114..1c0594591c 100644
--- a/Applications/SystemMonitor/MemoryStatsWidget.cpp
+++ b/Applications/SystemMonitor/MemoryStatsWidget.cpp
@@ -11,9 +11,9 @@
MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph, GWidget* parent)
: GWidget(parent)
, m_graph(graph)
- , m_proc_memstat("/proc/memstat")
+ , m_proc_memstat(CFile::construct("/proc/memstat"))
{
- if (!m_proc_memstat.open(CIODevice::OpenMode::ReadOnly))
+ if (!m_proc_memstat->open(CIODevice::OpenMode::ReadOnly))
ASSERT_NOT_REACHED();
set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
set_preferred_size(0, 72);
@@ -59,9 +59,9 @@ static inline size_t bytes_to_kb(size_t bytes)
void MemoryStatsWidget::refresh()
{
- m_proc_memstat.seek(0);
+ m_proc_memstat->seek(0);
- auto file_contents = m_proc_memstat.read_all();
+ auto file_contents = m_proc_memstat->read_all();
auto json = JsonValue::from_string(file_contents).as_object();
unsigned kmalloc_eternal_allocated = json.get("kmalloc_eternal_allocated").to_u32();