From f46b019cb0a2f451234fdb4f20620b7e443da136 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Fri, 5 Apr 2024 00:00:33 +0200 Subject: Add gsl::owner --- deimos/core/api_registry.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'deimos/core/api_registry.cpp') diff --git a/deimos/core/api_registry.cpp b/deimos/core/api_registry.cpp index 24ea201..81dabf0 100644 --- a/deimos/core/api_registry.cpp +++ b/deimos/core/api_registry.cpp @@ -12,7 +12,7 @@ void RegisterLogApi(ApiRegistry*); struct ApiEntry { - const ApiEntry* next{}; + gsl::owner next{}; IdName name; void* impl; @@ -24,7 +24,7 @@ struct ApiEntry class ApiRegistryImpl: public ApiRegistry { Allocator* m_allocator; - const ApiEntry* m_head{}; + gsl::owner m_head{}; public: explicit ApiRegistryImpl(Allocator* allocator) : @@ -33,7 +33,7 @@ public: void Set(const IdName& name, void* impl) final { - auto* entry = m_allocator->New(name, impl); + gsl::owner entry = m_allocator->New(name, impl); entry->next = std::exchange(m_head, entry); } @@ -51,8 +51,8 @@ ApiRegistry* InitializeGlobalApiRegistry() { g_allocator_api = BootstrapAllocatorApi(); - Allocator* allocator = g_allocator_api->CreateChild(g_allocator_api->system, "API Registry"); - ApiRegistry* api_registry = allocator->New(allocator); + gsl::owner allocator = g_allocator_api->CreateChild(g_allocator_api->system, "API Registry"); + gsl::owner api_registry = allocator->New(allocator); api_registry->Set(g_allocator_api); -- cgit