From e83e9cb6b359b1e4fbf169153ceeaa2f3dee3d0d Mon Sep 17 00:00:00 2001 From: Lioncache Date: Fri, 10 Oct 2025 00:09:54 -0400 Subject: [PATCH] JSONPool: Make allocator funcs internally linked Makes it a little more explicit that these aren't used outside of this TU. --- Source/Common/JSONPool.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Source/Common/JSONPool.cpp b/Source/Common/JSONPool.cpp index 59a17ef47..fd97e9d5f 100644 --- a/Source/Common/JSONPool.cpp +++ b/Source/Common/JSONPool.cpp @@ -2,22 +2,19 @@ #include "Common/JSONPool.h" namespace FEX::JSON { -json_t* PoolInit(jsonPool_t* Pool); -json_t* PoolAlloc(jsonPool_t* Pool); +static json_t* PoolInit(jsonPool_t* Pool) { + auto* alloc = static_cast(Pool); + return &*alloc->json_objects.emplace(alloc->json_objects.end()); +} + +static json_t* PoolAlloc(jsonPool_t* Pool) { + auto* alloc = static_cast(Pool); + return &*alloc->json_objects.emplace(alloc->json_objects.end()); +} JsonAllocator::JsonAllocator() : jsonPool_t { - .init = FEX::JSON::PoolInit, - .alloc = FEX::JSON::PoolAlloc, + .init = PoolInit, + .alloc = PoolAlloc, } {} - -json_t* PoolInit(jsonPool_t* Pool) { - JsonAllocator* alloc = static_cast(Pool); - return &*alloc->json_objects.emplace(alloc->json_objects.end()); -} - -json_t* PoolAlloc(jsonPool_t* Pool) { - JsonAllocator* alloc = static_cast(Pool); - return &*alloc->json_objects.emplace(alloc->json_objects.end()); -} } // namespace FEX::JSON