From 2f154495318d626f62fd1c3c2ee2d083c5d44b2b Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 18 Apr 2020 12:23:47 +0300 Subject: [PATCH] Kernel: Compactify FileDescrption The next commit is going to make it bigger again by increasing the size of Lock, so make use of bitfields to make sure FileDescription still fits into 64 bytes, and so can still be allocated with the SlabAllocator. --- Kernel/FileSystem/FileDescription.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Kernel/FileSystem/FileDescription.h b/Kernel/FileSystem/FileDescription.h index 648e6f9366..fc240934cc 100644 --- a/Kernel/FileSystem/FileDescription.h +++ b/Kernel/FileSystem/FileDescription.h @@ -153,12 +153,12 @@ private: u32 m_file_flags { 0 }; - bool m_readable { false }; - bool m_writable { false }; - bool m_is_blocking { true }; - bool m_is_directory { false }; - bool m_should_append { false }; - bool m_direct { false }; + bool m_readable : 1 { false }; + bool m_writable : 1 { false }; + bool m_is_blocking : 1 { true }; + bool m_is_directory : 1 { false }; + bool m_should_append : 1 { false }; + bool m_direct : 1 { false }; FIFO::Direction m_fifo_direction { FIFO::Direction::Neither }; Lock m_lock { "FileDescription" };