1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

Kernel: Stop using *LockRefPtr for Process pointers

The only persistent one of these was Thread::m_process and that never
changes after initialization. Make it const to enforce this and switch
everything over to RefPtr & NonnullRefPtr.
This commit is contained in:
Andreas Kling 2023-04-02 18:35:32 +02:00
parent 19084ef743
commit 65438d8a85
11 changed files with 42 additions and 42 deletions

View file

@ -18,7 +18,7 @@ namespace Kernel {
class Coredump {
public:
static ErrorOr<NonnullOwnPtr<Coredump>> try_create(NonnullLockRefPtr<Process>, StringView output_path);
static ErrorOr<NonnullOwnPtr<Coredump>> try_create(NonnullRefPtr<Process>, StringView output_path);
static SpinlockProtected<OwnPtr<KString>, LockRank::None>& directory_path();
~Coredump() = default;
@ -65,7 +65,7 @@ private:
VirtualAddress m_vaddr;
};
Coredump(NonnullLockRefPtr<Process>, NonnullRefPtr<OpenFileDescription>, Vector<FlatRegionData>);
Coredump(NonnullRefPtr<Process>, NonnullRefPtr<OpenFileDescription>, Vector<FlatRegionData>);
static ErrorOr<NonnullRefPtr<OpenFileDescription>> try_create_target_file(Process const&, StringView output_path);
ErrorOr<void> write_elf_header();
@ -79,7 +79,7 @@ private:
ErrorOr<void> create_notes_regions_data(auto&) const;
ErrorOr<void> create_notes_metadata_data(auto&) const;
NonnullLockRefPtr<Process> m_process;
NonnullRefPtr<Process> const m_process;
NonnullRefPtr<OpenFileDescription> m_description;
size_t m_num_program_headers { 0 };
Vector<FlatRegionData> m_regions;