mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-19 00:31:52 +00:00
Kernel: Don't require AnonymousFiles to be mmap'd completely
AnonymousFile always allocates in multiples of a page size when created with anon_create. This is especially an issue if we use AnonymousFile shared memory to store a shared data structure that isn't exactly a multiple of a page in size. Therefore, we can just allow mmaps of AnonymousFile to map only an initial part of the shared memory. This makes SharedSingleProducerCircularQueue work when it's introduced later.
This commit is contained in:
parent
65b338ad04
commit
b0a2572577
Notes:
sideshowbarker
2024-07-17 11:37:22 +09:00
Author: https://github.com/kleinesfilmroellchen
Commit: b0a2572577
Pull-request: https://github.com/SerenityOS/serenity/pull/12102
Issue: https://github.com/SerenityOS/serenity/issues/11882
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/bgianfo
Reviewed-by: https://github.com/linusg
1 changed files with 0 additions and 3 deletions
|
@ -22,9 +22,6 @@ ErrorOr<Memory::Region*> AnonymousFile::mmap(Process& process, OpenFileDescripti
|
|||
if (offset != 0)
|
||||
return EINVAL;
|
||||
|
||||
if (range.size() != m_vmobject->size())
|
||||
return EINVAL;
|
||||
|
||||
return process.address_space().allocate_region_with_vmobject(range, m_vmobject, offset, {}, prot, shared);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue