Skip to content

Commit 9ea0d94

Browse files
deprecate the aligned_allocator_adaptor nobody is using it
1 parent 82e3ae1 commit 9ea0d94

7 files changed

Lines changed: 23 additions & 137 deletions

File tree

include/nbl/core/alloc/AllocatorTrivialBases.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
1+
// Copyright (C) 2018-2026 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#ifndef _NBL_CORE_ALLOCATOR_TRIVIAL_BASES_H_INCLUDED_
5+
#define _NBL_CORE_ALLOCATOR_TRIVIAL_BASES_H_INCLUDED_
46

5-
#ifndef __NBL_CORE_ALLOCATOR_TRIVIAL_BASES_H_INCLUDED__
6-
#define __NBL_CORE_ALLOCATOR_TRIVIAL_BASES_H_INCLUDED__
77

8-
9-
namespace nbl
10-
{
11-
namespace core
8+
namespace nbl::core
129
{
13-
1410
template<typename T> class AllocatorTrivialBase;
1511

1612
template<>
@@ -39,8 +35,5 @@ class NBL_FORCE_EBO AllocatorTrivialBase
3935
typedef const void* const_void_pointer;
4036
};
4137

42-
43-
}
4438
}
45-
4639
#endif

include/nbl/core/alloc/aligned_allocator.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
#include "nbl/core/memory/memory.h"
99
#include "nbl/core/alloc/AllocatorTrivialBases.h"
1010

11-
namespace nbl
12-
{
13-
namespace core
11+
namespace nbl::core
1412
{
1513

14+
// TODO: deprecate and replace everywhere with `refctd_memory_resource`
1615
template <class T, size_t overAlign=_NBL_DEFAULT_ALIGNMENT(T)>
1716
class NBL_FORCE_EBO alignas(alignof(void*)) aligned_allocator : public nbl::core::AllocatorTrivialBase<T>
1817
{
@@ -70,10 +69,8 @@ class NBL_FORCE_EBO alignas(alignof(void*)) aligned_allocator : public nbl::core
7069
};
7170

7271
template <typename T>
73-
using default_aligned_allocator = aligned_allocator<T, _NBL_DEFAULT_ALIGNMENT(T)>;
74-
75-
} // end namespace core
76-
} // end namespace nbl
72+
using default_aligned_allocator = aligned_allocator<T,_NBL_DEFAULT_ALIGNMENT(T)>;
7773

74+
} // end namespace nbl::core
7875
#endif
7976

include/nbl/core/alloc/aligned_allocator_adaptor.h

Lines changed: 0 additions & 100 deletions
This file was deleted.

include/nbl/core/alloc/refctd_memory_resource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019-2025 - DevSH Graphics Programming Sp. z O.O.
1+
// Copyright (C) 2021-2026 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine" and was originally part of the "Irrlicht Engine"
33
// For conditions of distribution and use, see copyright notice in nabla.h
44
// See the original file in irrlicht source for authors

include/nbl/core/decl/Types.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
1+
// Copyright (C) 2018-2026 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#ifndef _NBL_CORE_TYPES_H_INCLUDED_
5+
#define _NBL_CORE_TYPES_H_INCLUDED_
46

5-
#ifndef __NBL_CORE_TYPES_H_INCLUDED__
6-
#define __NBL_CORE_TYPES_H_INCLUDED__
77

88
#include "nbl/core/decl/compile_config.h"
99

@@ -27,17 +27,18 @@
2727
#include "nbl/core/memory/new_delete.h"
2828

2929
#include "nbl/core/alloc/aligned_allocator.h"
30-
#include "nbl/core/alloc/aligned_allocator_adaptor.h"
3130

3231
#include <mutex>
3332

33+
3434
namespace nbl::core
3535
{
3636

3737
template<typename Compared, typename T>
3838
using add_const_if_const_t = std::conditional_t<std::is_const_v<Compared>,std::add_const_t<T>,T>;
3939

4040

41+
// TODO: deprecate and replace with `refctd_memory_resource` whnever possible
4142
template<typename T>
4243
using allocator = _NBL_DEFAULT_ALLOCATOR_METATYPE<T>;
4344

include/nbl/core/declarations.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
1+
// Copyright (C) 2018-2026 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4-
5-
#ifndef __NBL_CORE_DECLARATIONS_H_INCLUDED__
6-
#define __NBL_CORE_DECLARATIONS_H_INCLUDED__
4+
#ifndef _NBL_CORE_DECLARATIONS_H_INCLUDED_
5+
#define _NBL_CORE_DECLARATIONS_H_INCLUDED_
76

87
#include "nbl/core/decl/compile_config.h"
98

@@ -23,7 +22,6 @@
2322
#include "nbl/core/alloc/address_allocator_traits.h"
2423
#include "nbl/core/alloc/AlignedBase.h"
2524
#include "nbl/core/alloc/aligned_allocator.h"
26-
#include "nbl/core/alloc/aligned_allocator_adaptor.h"
2725
#include "nbl/core/alloc/AllocatorTrivialBases.h"
2826
#include "nbl/core/alloc/GeneralpurposeAddressAllocator.h"
2927
#include "nbl/core/alloc/IAddressAllocator.h"

include/nbl/core/memory/new_delete.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
1+
// Copyright (C) 2018-2026 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#ifndef _NBL_CORE_NEW_DELETE_H_INCLUDED_
5+
#define _NBL_CORE_NEW_DELETE_H_INCLUDED_
46

5-
#ifndef __NBL_CORE_NEW_DELETE_H_INCLUDED__
6-
#define __NBL_CORE_NEW_DELETE_H_INCLUDED__
77

8-
#include <memory>
98

109
#include "nbl/macros.h"
1110
#include "nbl/core/alloc/aligned_allocator.h"
1211

12+
#include <memory>
1313

1414

1515
//! Allocator MUST provide a function with signature `pointer allocate(size_type n, size_type alignment, const_void_pointer hint=nullptr) noexcept`
1616
#define _NBL_DEFAULT_ALLOCATOR_METATYPE nbl::core::aligned_allocator
1717

18+
// TODO: deprecate and replace usages with `refctd_memory_resource` default
1819
namespace nbl
1920
{
2021
namespace core
@@ -120,9 +121,7 @@ struct AlignedWithAllocator
120121
_NBL_ASSERT_ALLOCATOR_VALUE_TYPE(std::remove_reference_t<std::remove_pointer_t<decltype(_obj)>>,decltype(_allocator))
121122

122123

123-
namespace nbl
124-
{
125-
namespace core
124+
namespace nbl::core
126125
{
127126
/**
128127
//Maybe: Create a nbl::AllocatedByDynamicAllocation class with a static function new[] like operator that takes an DynamicAllocator* parameter
@@ -149,7 +148,5 @@ struct alligned_delete
149148
};
150149

151150
}
152-
}
153-
154151
#endif
155152

0 commit comments

Comments
 (0)