rodecomp/Source/Utility/Async/NRecycleObjectPoolMgr.cpp
ragnarok-clanker e168b4e4a6 Restore translation-unit ownership and publish verified source corrections
Owner-authorized source migration: 31 helper-only translation units were merged into their callers or existing inline headers; both build manifests updated. Includes the preserved source payload, Lua configuration matching wowdecomp, and exact malloca expansion without diagnostic pragmas.

449 native units compiled locally and 449 staged units compiled by the pinned server toolchain. No previously byte-matched function regressed. Compiler mapping diagnostics remain recorded as needs_cleanup, not accepted or peer-confirmed. Existing independent review records are preserved. README.md is intentionally unchanged.
2026-10-25 15:42:21 +00:00

50 lines
1.3 KiB
C++

#include "Utility/Async/NRecycleObjectPoolMgr.h"
// INLINED
std::size_t NRecycleObjectPoolMgr::NameHash::operator()(const std::string& name) const {
std::uint32_t hash = 2166136261;
for (unsigned char byte : name) {
hash = 16777619 * (hash ^ byte);
}
std::uint32_t value = hash & 0x7FFFFFFF;
std::int32_t reduced = static_cast<std::int32_t>(16807 * (value % 127773)) - static_cast<std::int32_t>(2836 * (value / 127773));
if (reduced < 0) {
reduced += 0x7FFFFFFF;
}
return static_cast<std::uint32_t>(reduced);
}
// OFFSET: 0x00736B30
// FUNCTION: fn_07632
NRecycleObjectPoolMgr::NRecycleObjectPoolMgr() : m_enabled(false) {
this->m_pools.rehash(8);
this->m_enabled = true;
}
// OFFSET: 0x00736DE0
// OFFSET: 0x00736E50
// FUNCTION: fn_07635
NRecycleObjectPoolMgr::~NRecycleObjectPoolMgr() = default;
// OFFSET: 0x00736EE0
// FUNCTION: fn_07637
NRecycleObject* NRecycleObjectPoolMgr::Acquire(std::string poolName) {
auto pool = this->m_pools.find(poolName);
if (pool == this->m_pools.end()) {
return nullptr;
}
return pool->second->Acquire();
}
// OFFSET: 0x00736F60
// FUNCTION: fn_07638
void NRecycleObjectPoolMgr::Release(std::string poolName, NRecycleObject* object) {
auto pool = this->m_pools.find(poolName);
if (pool != this->m_pools.end()) {
pool->second->Release(object);
}
}