diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-05 00:00:33 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-05 00:00:33 +0200 |
commit | f46b019cb0a2f451234fdb4f20620b7e443da136 (patch) | |
tree | 29a3b0f1441cef9932e0770b155294be55d11e9e /deimos/core/api_registry.cpp | |
parent | 8970c40ce9a9a4e5f582b48f69b77bd90d8e678e (diff) |
Add gsl::owner
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);
|