summaryrefslogtreecommitdiff
path: root/deimos
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-04-13 00:11:04 +0200
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-04-13 00:11:04 +0200
commita6abeaaf3a68e3b7072f75acae4cfdf720ad20f4 (patch)
tree1da880d379fa6e108467a26e23aa42a301377a49 /deimos
parent00143afc01dbca797471181105738042e89f15ae (diff)
Re-add gsl::owner on the Allocator API
Diffstat (limited to 'deimos')
-rw-r--r--deimos/core/allocator.cpp4
-rw-r--r--deimos/core/allocator.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/deimos/core/allocator.cpp b/deimos/core/allocator.cpp
index cd3de9e..b42861c 100644
--- a/deimos/core/allocator.cpp
+++ b/deimos/core/allocator.cpp
@@ -8,8 +8,8 @@ namespace deimos
class SystemAllocatorImpl : public IAllocator
{
public:
- void* Reallocate(
- void* old_ptr, int64_t /* old_size */, int64_t new_size,
+ gsl::owner<void*> Reallocate(
+ gsl::owner<void*> old_ptr, int64_t /* old_size */, int64_t new_size,
MemoryScope /* scope */, const SourceLocation& /* source_location */) override
{
if (old_ptr == nullptr)
diff --git a/deimos/core/allocator.h b/deimos/core/allocator.h
index 8f00610..e65f316 100644
--- a/deimos/core/allocator.h
+++ b/deimos/core/allocator.h
@@ -40,7 +40,7 @@ public:
constexpr IAllocator* allocator() const { return m_allocator; }
[[nodiscard]]
- constexpr void* Allocate(
+ constexpr gsl::owner<void*> Allocate(
int64_t new_size,
const SourceLocation& source_location = {})
{
@@ -48,15 +48,15 @@ public:
}
[[nodiscard]]
- void* Reallocate(
- void* old_ptr, int64_t old_size, int64_t new_size,
+ gsl::owner<void*> Reallocate(
+ gsl::owner<void*> old_ptr, int64_t old_size, int64_t new_size,
const SourceLocation& source_location = {})
{
return m_allocator->Reallocate(old_ptr, old_size, new_size, m_scope, source_location);
}
constexpr void Free(
- void* old_ptr, int64_t old_size,
+ gsl::owner<void*> old_ptr, int64_t old_size,
const SourceLocation& source_location = {})
{
(void)m_allocator->Reallocate(old_ptr, old_size, 0, m_scope, source_location);