diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-03 23:39:26 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-03 23:39:44 +0200 |
commit | fcc3c353fd250994dec73c4aa4bd66d976c910bb (patch) | |
tree | d009d175c4a8aec3d7b639fa7a37c635b072d037 /deimos/core/allocator.h | |
parent | 636b98e0ec8771c4377fd78e036da6acbec109db (diff) |
Separate gsl stuff, and use std-like int types
Diffstat (limited to 'deimos/core/allocator.h')
-rw-r--r-- | deimos/core/allocator.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/deimos/core/allocator.h b/deimos/core/allocator.h index 967bbb1..677501d 100644 --- a/deimos/core/allocator.h +++ b/deimos/core/allocator.h @@ -6,7 +6,7 @@ namespace deimos
{
-struct MemoryScope { uint32 id; };
+struct MemoryScope { uint32_t id; };
struct IAllocator
{
@@ -18,7 +18,7 @@ struct IAllocator [[nodiscard]]
virtual void* Reallocate(
- void* old_ptr, int64 old_size, int64 new_size,
+ void* old_ptr, int64_t old_size, int64_t new_size,
MemoryScope scope, const SourceLocation& source_location = {}) = 0;
};
@@ -39,7 +39,7 @@ public: [[nodiscard]]
constexpr void* Allocate(
- int64 new_size,
+ int64_t new_size,
const SourceLocation& source_location = {})
{
return m_allocator->Reallocate(nullptr, 0, new_size, m_scope, source_location);
@@ -47,14 +47,14 @@ public: [[nodiscard]]
void* Reallocate(
- void* old_ptr, int64 old_size, int64 new_size,
+ 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 old_size,
+ void* old_ptr, int64_t old_size,
const SourceLocation& source_location = {})
{
(void)m_allocator->Reallocate(old_ptr, old_size, 0, m_scope, source_location);
@@ -117,7 +117,7 @@ public: template<typename T>
void Delete(T* t, const SourceLocation& source_location = {})
{
- if constexpr (!kIsTriviallyDestructible<T>)
+ if constexpr (!std::is_trivially_destructible_v<T>)
{
t->~T();
}
|