mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:27:35 +00:00
Kernel: Remove use of copy_ref() in favor of regular RefPtr copies.
This is obviously more readable. If we ever run into a situation where ref count churn is actually causing trouble in the future, we can deal with it then. For now, let's keep it simple. :^)
This commit is contained in:
parent
560d037c41
commit
5254a320d8
14 changed files with 34 additions and 34 deletions
|
@ -2,12 +2,12 @@
|
|||
|
||||
// #define OFFD_DEBUG
|
||||
|
||||
NonnullRefPtr<DiskPartition> DiskPartition::create(NonnullRefPtr<DiskDevice>&& device, unsigned block_offset)
|
||||
NonnullRefPtr<DiskPartition> DiskPartition::create(NonnullRefPtr<DiskDevice> device, unsigned block_offset)
|
||||
{
|
||||
return adopt(*new DiskPartition(move(device), block_offset));
|
||||
}
|
||||
|
||||
DiskPartition::DiskPartition(NonnullRefPtr<DiskDevice>&& device, unsigned block_offset)
|
||||
DiskPartition::DiskPartition(NonnullRefPtr<DiskDevice> device, unsigned block_offset)
|
||||
: m_device(move(device))
|
||||
, m_block_offset(block_offset)
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
class DiskPartition final : public DiskDevice {
|
||||
public:
|
||||
static NonnullRefPtr<DiskPartition> create(NonnullRefPtr<DiskDevice>&& device, unsigned block_offset);
|
||||
static NonnullRefPtr<DiskPartition> create(NonnullRefPtr<DiskDevice>, unsigned block_offset);
|
||||
virtual ~DiskPartition();
|
||||
|
||||
virtual unsigned block_size() const override;
|
||||
|
@ -17,7 +17,7 @@ public:
|
|||
private:
|
||||
virtual const char* class_name() const override;
|
||||
|
||||
DiskPartition(NonnullRefPtr<DiskDevice>&&, unsigned);
|
||||
DiskPartition(NonnullRefPtr<DiskDevice>, unsigned block_offset);
|
||||
|
||||
NonnullRefPtr<DiskDevice> m_device;
|
||||
unsigned m_block_offset;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#define MBR_DEBUG
|
||||
|
||||
MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<DiskDevice>&& device)
|
||||
MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<DiskDevice> device)
|
||||
: m_device(move(device))
|
||||
{
|
||||
}
|
||||
|
@ -65,5 +65,5 @@ RefPtr<DiskPartition> MBRPartitionTable::partition(unsigned index)
|
|||
kprintf("MBRPartitionTable::partition: found partition index=%d type=%x\n", index, entry.type);
|
||||
#endif
|
||||
|
||||
return DiskPartition::create(m_device.copy_ref(), entry.offset);
|
||||
return DiskPartition::create(m_device, entry.offset);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class MBRPartitionTable {
|
|||
AK_MAKE_ETERNAL
|
||||
|
||||
public:
|
||||
MBRPartitionTable(NonnullRefPtr<DiskDevice>&& device);
|
||||
MBRPartitionTable(NonnullRefPtr<DiskDevice>);
|
||||
~MBRPartitionTable();
|
||||
|
||||
bool initialize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue