mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00
Kernel: Break retain cycle between Inode and VMObject.
There's no need for an Inode to keep its corresponding VMObject alive. Obviously there are huge benefits to keeping a filesystem cache, but leaking everything is hardly the right strategy. :^)
This commit is contained in:
parent
e1be5a468d
commit
d4ba155711
4 changed files with 9 additions and 9 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <AK/HashTable.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/Weakable.h>
|
||||
#include <Kernel/VirtualFileSystem.h>
|
||||
|
||||
#define PAGE_ROUND_UP(x) ((((dword)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1)))
|
||||
|
@ -77,7 +78,7 @@ private:
|
|||
HashMap<unsigned, RetainPtr<PhysicalPage>> m_physical_pages;
|
||||
};
|
||||
|
||||
class VMObject : public Retainable<VMObject> {
|
||||
class VMObject : public Retainable<VMObject>, public Weakable<VMObject> {
|
||||
friend class MemoryManager;
|
||||
public:
|
||||
static RetainPtr<VMObject> create_file_backed(RetainPtr<Inode>&&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue