Kernel: Increase maximum PTY count from 8 to 64

Let's allow users to allocate more pseudo-terminals if they want.
This commit is contained in:
Andreas Kling 2021-08-07 15:08:32 +02:00
parent c4604bc080
commit 7f2791f02e
Notes: sideshowbarker 2024-07-18 07:18:29 +09:00
2 changed files with 3 additions and 2 deletions

View File

@ -24,7 +24,6 @@ PTYMultiplexer& PTYMultiplexer::the()
UNMAP_AFTER_INIT PTYMultiplexer::PTYMultiplexer()
: CharacterDevice(5, 2)
{
constexpr unsigned max_pty_pairs = 8;
m_freelist.ensure_capacity(max_pty_pairs);
for (int i = max_pty_pairs; i > 0; --i)
m_freelist.unchecked_append(i - 1);

View File

@ -44,7 +44,9 @@ private:
virtual StringView class_name() const override { return "PTYMultiplexer"; }
Mutex m_lock { "PTYMultiplexer" };
Vector<unsigned> m_freelist;
static constexpr size_t max_pty_pairs = 64;
Vector<unsigned, max_pty_pairs> m_freelist;
};
}