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

Make font loading use mmap().

This exposed a serious race condition in page_in_from_inode().
Reordered the logic and added a paging lock to VMObject.
Now, only one process can page in from a VMObject at a time.
There are definitely ways to optimize this, for instance by making
the locking be per-page instead. It's not something that I'm going
to worry about right now though.
This commit is contained in:
Andreas Kling 2019-02-03 01:36:25 +01:00
parent 7f91aec25c
commit abe3f515b1
4 changed files with 65 additions and 39 deletions

View file

@ -12,6 +12,8 @@ public:
RetainPtr<Font> clone() const;
static RetainPtr<Font> load_from_memory(const byte*);
#ifdef USERLAND
static RetainPtr<Font> load_from_file(const String& path);
bool write_to_file(const String& path);