summaryrefslogtreecommitdiff
path: root/Kernel/VM/AnonymousVMObject.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-07 18:06:17 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-07 18:09:32 +0200
commit6bdb81ad87708015be8252b5e431a20b498048ff (patch)
treeed0bbcbf862a4f637f999f8cec53edb032e670f6 /Kernel/VM/AnonymousVMObject.h
parentcb2d572a14d24b4d61b4a55ae31f606858b59162 (diff)
downloadserenity-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.h24
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; }
+};