summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-01 13:39:28 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-01 13:39:28 +0100
commit065f0aee35331cd721c163a66ca68183f5ff4517 (patch)
tree07d6c348fbde1e2d96c2bc138febcaaa6462cf55 /Kernel/Process.h
parentfce81d376c73e79093df3ae0560e5d8f288eae43 (diff)
downloadserenity-065f0aee35331cd721c163a66ca68183f5ff4517.zip
Preallocate the maximum number of FileHandle pointers (fds) in every process.
This could even use a more specific data structure since it doesn't need the grow/shrink capabilities of a vector.
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r--Kernel/Process.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h
index d4edfba82f..78d5bfccb4 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -124,8 +124,6 @@ public:
pid_t waitee() const { return m_waitee; }
- size_t fileHandleCount() const { return m_fileHandles.size(); }
-
dword framePtr() const { return m_tss.ebp; }
dword stackPtr() const { return m_tss.esp; }
dword stackTop() const { return m_tss.ss == 0x10 ? m_stackTop0 : m_stackTop3; }
@@ -137,6 +135,8 @@ public:
InodeIdentifier cwdInode() const { return m_cwd ? m_cwd->inode : InodeIdentifier(); }
InodeIdentifier executableInode() const { return m_executable ? m_executable->inode : InodeIdentifier(); }
+ size_t number_of_open_file_descriptors() const;
+
private:
friend class MemoryManager;
friend bool scheduleNewProcess();
@@ -164,7 +164,7 @@ private:
DWORD m_wakeupTime { 0 };
TSS32 m_tss;
Descriptor* m_ldtEntries { nullptr };
- Vector<OwnPtr<FileHandle>> m_fileHandles;
+ Vector<OwnPtr<FileHandle>> m_file_descriptors;
RingLevel m_ring { Ring0 };
int m_error { 0 };
void* m_kernelStack { nullptr };
@@ -172,7 +172,7 @@ private:
pid_t m_waitee { -1 };
int m_waiteeStatus { 0 };
int m_fdBlockedOnRead { -1 };
- size_t m_maxFileHandles { 16 };
+ size_t m_max_open_file_descriptors { 16 };
RetainPtr<VirtualFileSystem::Node> m_cwd;
RetainPtr<VirtualFileSystem::Node> m_executable;