Skip to content

Commit

Permalink
Improve debug mode description.
Browse files Browse the repository at this point in the history
Co-authored-by: Antonio Cuni <[email protected]>
  • Loading branch information
2 people authored and fangerer committed Sep 13, 2021
1 parent 710374b commit 76b5706
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions docs/debug-mode.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
Debug Mode
==========

HPy includes a debug mode that may be activated at *run time* with
*no overhead*. This is possible because the whole of the HPy API is provided
HPy includes a debug mode which includes a lot of useful run-time checks to
ensure that C extensions use the API correctly. The major points of the debug mode are:

1. no special compilation flags are required: it is enough to compile the extension
with the Universal ABI.

2. The debug mode can be activated at *import time*, and it can be activated
per-extension.

3. You pay the overhead of the debug mode only if you use it. Extensions loaded
without the debug mode run at full speed.

This is possible because the whole of the HPy API is provided
as part of the HPy context, so debug mode can pass in a special debugging
context (that wraps the normal context) without affecting the performance of
the regular context at all.
Expand Down

0 comments on commit 76b5706

Please sign in to comment.