diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-08-07 18:06:17 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-07 18:09:32 +0200 |
commit | 6bdb81ad87708015be8252b5e431a20b498048ff (patch) | |
tree | ed0bbcbf862a4f637f999f8cec53edb032e670f6 /Kernel/VM/AnonymousVMObject.h | |
parent | cb2d572a14d24b4d61b4a55ae31f606858b59162 (diff) | |
download | serenity-6bdb81ad87708015be8252b5e431a20b498048ff.zip |
Kernel: Split VMObject into two classes: Anonymous- and InodeVMObject
InodeVMObject is a VMObject with an underlying Inode in the filesystem.
AnonymousVMObject has no Inode.
I'm happy that InodeVMObject::inode() can now return Inode& instead of
VMObject::inode() return Inode*. :^)
Diffstat (limited to 'Kernel/VM/AnonymousVMObject.h')
-rw-r--r-- | Kernel/VM/AnonymousVMObject.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Kernel/VM/AnonymousVMObject.h b/Kernel/VM/AnonymousVMObject.h new file mode 100644 index 0000000000..ceec9de8d5 --- /dev/null +++ b/Kernel/VM/AnonymousVMObject.h @@ -0,0 +1,24 @@ +#pragma once + +#include <Kernel/VM/PhysicalAddress.h> +#include <Kernel/VM/VMObject.h> + +class AnonymousVMObject final : public VMObject { +public: + virtual ~AnonymousVMObject() override; + + static NonnullRefPtr<AnonymousVMObject> create_with_size(size_t); + static NonnullRefPtr<AnonymousVMObject> create_for_physical_range(PhysicalAddress, size_t); + virtual NonnullRefPtr<VMObject> clone() override; + +private: + explicit AnonymousVMObject(size_t); + explicit AnonymousVMObject(const AnonymousVMObject&); + AnonymousVMObject(PhysicalAddress, size_t); + + AnonymousVMObject& operator=(const AnonymousVMObject&) = delete; + AnonymousVMObject& operator=(AnonymousVMObject&&) = delete; + AnonymousVMObject(AnonymousVMObject&&) = delete; + + virtual bool is_anonymous() const override { return true; } +}; |