/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace //Unnamed namespace
{
//Memory pool used to allocate new RenderTaskLists. Memory used by this pool will be released when shutting down DALi
-Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::RenderTaskList> gRenderTaskListMemoryPool;
-
+Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::RenderTaskList>& GetRenderTaskListMemoryPool()
+{
+ static Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::RenderTaskList> gRenderTaskListMemoryPool;
+ return gRenderTaskListMemoryPool;
+}
} // unnamed namespace
namespace Dali
{
RenderTaskList* RenderTaskList::New()
{
- return new(gRenderTaskListMemoryPool.AllocateRawThreadSafe()) RenderTaskList();
+ return new(GetRenderTaskListMemoryPool().AllocateRawThreadSafe()) RenderTaskList();
}
RenderTaskList::RenderTaskList()
void RenderTaskList::operator delete(void* ptr)
{
- gRenderTaskListMemoryPool.FreeThreadSafe(static_cast<RenderTaskList*>(ptr));
+ GetRenderTaskListMemoryPool().FreeThreadSafe(static_cast<RenderTaskList*>(ptr));
}
void RenderTaskList::SetRenderMessageDispatcher(RenderMessageDispatcher* renderMessageDispatcher)
uint32_t RenderTaskList::GetMemoryPoolCapacity()
{
- return gRenderTaskListMemoryPool.GetCapacity();
+ return GetRenderTaskListMemoryPool().GetCapacity();
}
} // namespace SceneGraph