summaryrefslogtreecommitdiff
path: root/Kernel/Net/Routing.cpp
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-08-20 09:36:06 -0600
committerAndreas Kling <kling@serenityos.org>2020-08-21 11:47:35 +0200
commitf48feae0b2a300992479abf0b2ded85e45ac6045 (patch)
treed0b01169a60261135ee15a8d4a6abd01785a7bec /Kernel/Net/Routing.cpp
parent527c8047fe0a08ade2e17fd096ad9b4ebc103ec5 (diff)
downloadserenity-f48feae0b2a300992479abf0b2ded85e45ac6045.zip
Kernel: Switch singletons to use new Singleton class
Fixes #3226
Diffstat (limited to 'Kernel/Net/Routing.cpp')
-rw-r--r--Kernel/Net/Routing.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Net/Routing.cpp b/Kernel/Net/Routing.cpp
index b2b9786a2e..5f72ab1166 100644
--- a/Kernel/Net/Routing.cpp
+++ b/Kernel/Net/Routing.cpp
@@ -28,17 +28,17 @@
#include <Kernel/Net/LoopbackAdapter.h>
#include <Kernel/Net/Routing.h>
#include <Kernel/Thread.h>
+#include <Kernel/Singleton.h>
//#define ROUTING_DEBUG
namespace Kernel {
+static auto s_arp_table = make_singleton<Lockable<HashMap<IPv4Address, MACAddress>>>();
+
Lockable<HashMap<IPv4Address, MACAddress>>& arp_table()
{
- static Lockable<HashMap<IPv4Address, MACAddress>>* the;
- if (!the)
- the = new Lockable<HashMap<IPv4Address, MACAddress>>;
- return *the;
+ return *s_arp_table;
}
bool RoutingDecision::is_zero() const