1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:44:58 +00:00

LibCore: Make MappedFile OwnPtr-based

Since it will become a stream in a little bit, it should behave like all
non-trivial stream classes, who are not primarily intended to have
shared ownership to make closing behavior more predictable. Across all
uses of MappedFile, there is only one use case of shared mapped files in
LibVideo, which now uses the thin SharedMappedFile wrapper.
This commit is contained in:
kleines Filmröllchen 2023-09-26 00:54:34 +02:00 committed by Tim Schumacher
parent 5b2496e522
commit 062e0db46c
32 changed files with 80 additions and 64 deletions

View file

@ -29,7 +29,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
args_parser.add_positional_argument(path, "Path to i386 binary file", "path");
args_parser.parse(args);
RefPtr<Core::MappedFile> file;
OwnPtr<Core::MappedFile const> file;
u8 const* asm_data = nullptr;
size_t asm_size = 0;
if ((TRY(Core::System::stat(path))).st_size > 0) {