Skip to content

Commit

Permalink
GFX_TIMSORT_ENABLE_AUDIT now automatically enables asserts too
Browse files Browse the repository at this point in the history
  • Loading branch information
Morwenn committed Jan 27, 2024
1 parent 0be56ef commit e02eb81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ conan install --requires=timsort/3.0.0

The following configuration macros allow `gfx::timsort` and `gfx::timmerge` to emit diagnostics, which can be helpful
to diagnose issues:
* Defining `GFX_TIMSORT_ENABLE_ASSERT` inserts assertions in key locations in the algorithm to avoid logic errors.
* Defining `GFX_TIMSORT_ENABLE_ASSERT` light inserts assertions in key locations in the algorithm to avoid logic errors.
* Defining `GFX_TIMSORT_ENABLE_AUDIT` inserts assertions that verify pre- and postconditions. These verifications can
slow the algorithm down significantly. Enable the audits only while testing or debugging.
slow the algorithm down significantly. Enable the audits only while testing or debugging. Enabling audits automatically
enables lighter assertions too.
* Defining `GFX_TIMSORT_ENABLE_LOG` inserts logs in key locations, which allow to follow more closely the flow of the
algorithm.

Expand Down
3 changes: 0 additions & 3 deletions include/gfx/timsort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@

#if defined(GFX_TIMSORT_ENABLE_ASSERT) || defined(GFX_TIMSORT_ENABLE_AUDIT)
# include <cassert>
#endif

#ifdef GFX_TIMSORT_ENABLE_ASSERT
# define GFX_TIMSORT_ASSERT(expr) assert(expr)
#else
# define GFX_TIMSORT_ASSERT(expr) ((void)0)
Expand Down

0 comments on commit e02eb81

Please sign in to comment.