diff options
Diffstat (limited to 'deimos/core/api_registry.cpp')
-rw-r--r-- | deimos/core/api_registry.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<const ApiEntry*> next{};
IdName name;
void* impl;
@@ -24,7 +24,7 @@ struct ApiEntry class ApiRegistryImpl: public ApiRegistry
{
Allocator* m_allocator;
- const ApiEntry* m_head{};
+ gsl::owner<const ApiEntry*> 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<ApiEntry>(name, impl);
+ gsl::owner<ApiEntry*> entry = m_allocator->New<ApiEntry>(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<ApiRegistryImpl>(allocator);
+ gsl::owner<Allocator*> allocator = g_allocator_api->CreateChild(g_allocator_api->system, "API Registry");
+ gsl::owner<ApiRegistry*> api_registry = allocator->New<ApiRegistryImpl>(allocator);
api_registry->Set(g_allocator_api);
|