diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-09-11 09:51:43 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-12 16:36:52 +0200 |
commit | d158f2ed896abd46e8df2c1dc9ba41413bc87e6e (patch) | |
tree | 612e87f1e5a3a1bc55b46a05de94cacbba0837bc /Kernel | |
parent | 27a124f7d88a9c59650b4881b95b166de887f055 (diff) | |
download | serenity-d158f2ed896abd46e8df2c1dc9ba41413bc87e6e.zip |
Kernel: Zero initialize SlabAllocator member variables
PVS-Studio flagged these as uninitialized. While there is no bug here,
it is our policy to always initialize members to avoid potential bugs
in the future.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Heap/SlabAllocator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Heap/SlabAllocator.cpp b/Kernel/Heap/SlabAllocator.cpp index 9a74e8c17c..179cdcc0b8 100644 --- a/Kernel/Heap/SlabAllocator.cpp +++ b/Kernel/Heap/SlabAllocator.cpp @@ -97,8 +97,8 @@ private: }; Atomic<FreeSlab*> m_freelist { nullptr }; - Atomic<size_t, AK::MemoryOrder::memory_order_relaxed> m_num_allocated; - size_t m_slab_count; + Atomic<size_t, AK::MemoryOrder::memory_order_relaxed> m_num_allocated { 0 }; + size_t m_slab_count { 0 }; void* m_base { nullptr }; void* m_end { nullptr }; |