Skip to content

Commit 1d32fb5

Browse files
committed
Apply prepare changes
1 parent bd03ddd commit 1d32fb5

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

bindings/python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
5-
# pip-compile bindings/python/requirements.in
5+
# pip-compile --pre bindings/python/requirements.in
66
#

include/geode/basic/assert.hpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,41 @@ namespace geode
5353
{
5454
static constexpr int MAX_STACK_DEPTH = 10;
5555
static constexpr int NB_SKIPPED_STACKS = 1;
56+
static constexpr int SYMBOL_SIZE = 1024;
5657

5758
public:
5859
template < typename... Args >
5960
explicit OpenGeodeException( const Args&... message )
6061
: std::runtime_error{ absl::StrCat( message... ) },
6162
stack_size_{ absl::GetStackTrace(
62-
stack_, MAX_STACK_DEPTH, NB_SKIPPED_STACKS ) }
63+
stack_.data(), MAX_STACK_DEPTH, NB_SKIPPED_STACKS ) }
6364
{
6465
}
6566

66-
virtual ~OpenGeodeException() noexcept = default;
67+
~OpenGeodeException() noexcept override = default;
6768

6869
std::string stack_trace() const
6970
{
7071
std::string stack_string;
7172
for( auto frame = 0; frame < stack_size_; ++frame )
7273
{
7374
absl::StrAppend( &stack_string, " ", frame, ": " );
74-
if( char symbol[1024];
75-
absl::Symbolize( stack_[frame], symbol, sizeof( symbol ) ) )
75+
if( std::array< char, SYMBOL_SIZE > symbol; absl::Symbolize(
76+
stack_[frame], symbol.data(), sizeof( symbol ) ) )
7677
{
77-
absl::StrAppend( &stack_string, symbol, "\n" );
78+
absl::StrAppend( &stack_string, symbol.data() );
7879
}
7980
else
8081
{
81-
absl::StrAppend( &stack_string, "Unknown \n" );
82+
absl::StrAppend( &stack_string, "Unknown" );
8283
}
84+
absl::StrAppend( &stack_string, "\n" );
8385
}
8486
return stack_string;
8587
}
8688

8789
private:
88-
void* stack_[MAX_STACK_DEPTH];
90+
std::array< void*, MAX_STACK_DEPTH > stack_;
8991
int stack_size_;
9092
};
9193

0 commit comments

Comments
 (0)