aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/vfs/vfs_real.cpp
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-09-25 07:54:49 +0200
committercrueter <crueter@eden-emu.dev>2026-09-25 07:54:49 +0200
commitbebc19da3253f13ceb5abfe8560cdbdc32ea7d8a (patch)
tree3119f32d2873ee0d00ebde7208939045d1edb9dd /src/core/file_sys/vfs/vfs_real.cpp
parent99bf8cf51afb7b367cb5003f11a797499c71d13c (diff)
[common] Use `std::make_unique_for_overwrite<T>` in ScratchBuffer, remove polyfill (#4432)
Original `make_unique_for_overwrite.h` is well defined acc. to standard https://en.cppreference.com/cpp/memory/unique_ptr/make_unique, but by now most libc++ supports the function, so no need for polyfill. Test that this didn't break anything (for example, Megaman game that has video at the start), or anything using VIC/IPC. Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4432 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Diffstat (limited to 'src/core/file_sys/vfs/vfs_real.cpp')
-rw-r--r--src/core/file_sys/vfs/vfs_real.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/file_sys/vfs/vfs_real.cpp b/src/core/file_sys/vfs/vfs_real.cpp
index b04f832cd3..14e0caad3c 100644
--- a/src/core/file_sys/vfs/vfs_real.cpp
+++ b/src/core/file_sys/vfs/vfs_real.cpp
@@ -109,8 +109,7 @@ VirtualFile RealVfsFilesystem::OpenFileFromEntry(std::string_view path_, std::op
auto reference = std::make_unique<FileReference>();
this->InsertReferenceIntoListLocked(*reference);
- auto file = std::shared_ptr<RealVfsFile>(
- new RealVfsFile(*this, std::move(reference), path, perms, size, std::move(parent_path)));
+ auto file = std::make_shared<RealVfsFile>(*this, std::move(reference), path, perms, size, std::move(parent_path));
cache[path] = file;
return file;
@@ -177,7 +176,7 @@ bool RealVfsFilesystem::DeleteFile(std::string_view path_) {
VirtualDir RealVfsFilesystem::OpenDirectory(std::string_view path_, OpenMode perms) {
const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault);
- return std::shared_ptr<RealVfsDirectory>(new RealVfsDirectory(*this, path, perms));
+ return std::make_shared<RealVfsDirectory>(*this, path, perms);
}
VirtualDir RealVfsFilesystem::CreateDirectory(std::string_view path_, OpenMode perms) {
@@ -185,7 +184,7 @@ VirtualDir RealVfsFilesystem::CreateDirectory(std::string_view path_, OpenMode p
if (!FS::CreateDirs(path)) {
return nullptr;
}
- return std::shared_ptr<RealVfsDirectory>(new RealVfsDirectory(*this, path, perms));
+ return std::make_shared<RealVfsDirectory>(*this, path, perms);
}
VirtualDir RealVfsFilesystem::CopyDirectory(std::string_view old_path_,