Remove fxm::make_always

This commit is contained in:
Nekotekina 2019-08-26 16:58:49 +03:00
parent e41b234dc4
commit dd79a5efb7
3 changed files with 3 additions and 22 deletions

View File

@ -1469,7 +1469,7 @@ void ppu_load_exec(const ppu_exec_object& elf)
mem_size += 0xC000000; mem_size += 0xC000000;
} }
fxm::make_always<lv2_memory_container>(mem_size); fxm::make<lv2_memory_container>(mem_size);
ppu->cmd_push({ppu_cmd::initialize, 0}); ppu->cmd_push({ppu_cmd::initialize, 0});

View File

@ -631,25 +631,6 @@ public:
return ptr; return ptr;
} }
// Create the object unconditionally (old object will be removed if it exists)
template <typename T, typename Make = T, typename... Args>
static std::enable_if_t<std::is_constructible<Make, Args...>::value, std::shared_ptr<T>> make_always(Args&&... args)
{
std::shared_ptr<T> ptr;
std::shared_ptr<void> old;
{
std::lock_guard lock(id_manager::g_mutex);
auto& cur = g_vec[get_type<T>()];
ptr = std::make_shared<Make>(std::forward<Args>(args)...);
old = std::move(cur);
cur = ptr;
}
return ptr;
}
// Emplace the object returned by provider() and return it if no object exists // Emplace the object returned by provider() and return it if no object exists
template <typename T, typename F, typename... Args> template <typename T, typename F, typename... Args>
static auto import(F&& provider, Args&&... args) -> decltype(static_cast<std::shared_ptr<T>>(provider(std::forward<Args>(args)...))) static auto import(F&& provider, Args&&... args) -> decltype(static_cast<std::shared_ptr<T>>(provider(std::forward<Args>(args)...)))

View File

@ -28,7 +28,7 @@ namespace rsx
// User memory + fifo size // User memory + fifo size
buffer_size = ::align<u32>(buffer_size, 0x100000) + 0x10000000; buffer_size = ::align<u32>(buffer_size, 0x100000) + 0x10000000;
// We are not allowed to drain all memory so add a little // We are not allowed to drain all memory so add a little
fxm::make_always<lv2_memory_container>(buffer_size + 0x1000000); fxm::make<lv2_memory_container>(buffer_size + 0x1000000);
const u32 contextAddr = vm::alloc(sizeof(rsx_context), vm::main); const u32 contextAddr = vm::alloc(sizeof(rsx_context), vm::main);
if (contextAddr == 0) if (contextAddr == 0)