File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 11#pragma once
22
33#include " Common.h"
4+ #include " Logging.h"
45
56#include < cstdint>
67#include < cstdlib>
@@ -69,10 +70,10 @@ class TinyVec {
6970 void reserve (SizeType new_cap)
7071 {
7172 if (new_cap <= _cap) return ;
72- if (sizeof (T) && new_cap > std::numeric_limits<SizeType>::max () / sizeof (T)) throw std::bad_alloc ( );
73+ if (sizeof (T) && new_cap > std::numeric_limits<SizeType>::max () / sizeof (T)) OS_PANIC_INSTANT ( " TVEC " , " Cannot allocate a buffer of given size! " );
7374
7475 void * newbuf = malloc (size_t (new_cap) * sizeof (T));
75- if (!newbuf) throw std::bad_alloc ( );
76+ if (!newbuf) OS_PANIC_INSTANT ( " TVEC " , " Could not allocate a buffer of given size! " );
7677 if (_data) {
7778 memcpy (newbuf, _data, size_t (_len) * sizeof (T));
7879 free (_data);
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ framework = arduino
1717build_flags =
1818 -std =c++2a
1919 -std =gnu++2a
20+ -fno-exceptions
21+ -fno-rtti
2022 -Wall
2123 -Wextra
2224 ; -Wpedantic
You can’t perform that action at this time.
0 commit comments