Skip to content

Commit 8daa819

Browse files
committed
💚 Remove template argument from single allocator
1 parent 5c6ed12 commit 8daa819

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

conanfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def _runtime_select(self):
6767
return "ARM_CORTEX_GCC"
6868
elif self._is_arm_cortex and self.options.runtime == "estell":
6969
return "ARM_CORTEX_ESTELL"
70+
else:
71+
return "ARM_CORTEX_GCC"
7072

7173
def validate(self):
7274
if self.settings.get_safe("compiler.cppstd"):

src/control.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,7 @@ std::terminate_handler get_terminate() noexcept
4646
*
4747
* This allocator can only allocates space for a single exception object at a
4848
* time.
49-
*
50-
* @tparam size - size of the exception object memory buffer. If this is set too
51-
* small (less than 128 bytes), then it is likely that the memory will not be
52-
* enough for any exception runtime and will result in terminate being called.
5349
*/
54-
template<size_t size>
5550
class single_exception_allocator : public std::pmr::memory_resource
5651
{
5752
public:
@@ -87,13 +82,12 @@ class single_exception_allocator : public std::pmr::memory_resource
8782
return this == &other;
8883
}
8984

90-
std::array<std::uint8_t, size> m_buffer{};
85+
std::array<std::uint8_t, 256> m_buffer{};
9186
bool m_allocated = false;
9287
};
9388

9489
// TODO(#11): Add macro to IFDEF this out if the user want to save 256 bytes.
95-
using default_exception_allocator = single_exception_allocator<256>;
96-
default_exception_allocator _default_allocator{}; // NOLINT
90+
single_exception_allocator _default_allocator{}; // NOLINT
9791
std::pmr::memory_resource* _exception_allocator =
9892
&_default_allocator; // NOLINT
9993

0 commit comments

Comments
 (0)