Skip to content

Commit

Permalink
Kernel: Tidy up SharedBuffer interface
Browse files Browse the repository at this point in the history
Make is_shared_with() const and hide private members.
  • Loading branch information
shannonbooth authored and awesomekling committed May 16, 2020
1 parent f7ae66c commit 8c1b01e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Kernel/SharedBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void SharedBuffer::sanity_check(const char* what)
}
}

bool SharedBuffer::is_shared_with(pid_t peer_pid)
bool SharedBuffer::is_shared_with(pid_t peer_pid) const
{
LOCKER(shared_buffers().lock(), Lock::Mode::Shared);
if (m_global)
Expand Down
3 changes: 2 additions & 1 deletion Kernel/SharedBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SharedBuffer {
}

void sanity_check(const char* what);
bool is_shared_with(pid_t peer_pid);
bool is_shared_with(pid_t peer_pid) const;
void* ref_for_process_and_get_address(Process& process);
void share_with(pid_t peer_pid);
void share_globally() { m_global = true; }
Expand All @@ -77,6 +77,7 @@ class SharedBuffer {
const PurgeableVMObject& vmobject() const { return m_vmobject; }
int id() const { return m_shbuf_id; }

private:
int m_shbuf_id { -1 };
bool m_writable { true };
bool m_global { false };
Expand Down

0 comments on commit 8c1b01e

Please sign in to comment.