1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

mmap all the font files!

Font now uses the same in-memory format as the font files we have on disk.
This allows us to simply mmap() the font files and not use any additional
memory for them. Very cool! :^)

Hacking on this exposed a bug in file-backed VMObjects where the first client
to instantiate a VMObject for a specific inode also got to decide its size.
Since file-backed VMObjects always have the same size as the underlying file,
this made no sense, so I removed the ability to even set a size in that case.
This commit is contained in:
Andreas Kling 2019-02-05 06:43:33 +01:00
parent 612c02307e
commit a258d6507a
11 changed files with 134 additions and 110 deletions

View file

@ -79,7 +79,7 @@ private:
class VMObject : public Retainable<VMObject> {
friend class MemoryManager;
public:
static RetainPtr<VMObject> create_file_backed(RetainPtr<Inode>&&, size_t);
static RetainPtr<VMObject> create_file_backed(RetainPtr<Inode>&&);
static RetainPtr<VMObject> create_anonymous(size_t);
static RetainPtr<VMObject> create_framebuffer_wrapper(PhysicalAddress, size_t);
RetainPtr<VMObject> clone();
@ -99,7 +99,7 @@ public:
Vector<RetainPtr<PhysicalPage>>& physical_pages() { return m_physical_pages; }
private:
VMObject(RetainPtr<Inode>&&, size_t);
VMObject(RetainPtr<Inode>&&);
explicit VMObject(VMObject&);
explicit VMObject(size_t);
VMObject(PhysicalAddress, size_t);