Skip to content

Commit

Permalink
Add very simple debug mode documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgestar authored and fangerer committed Sep 13, 2021
1 parent bfd1990 commit 58b1281
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/debug-mode.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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
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.

The debugging context can already check for:

* Leaked handles.
* Handles used after they are closed.

An HPy module may be loaded in debug mode using::

mod = hpy.universal.load(module_name, so_filename, debug=True)
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ There are several advantages to write your C extension in HPy:
overview
porting-guide
API <api>
debug-mode
api-reference/index
misc/index

Expand Down

0 comments on commit 58b1281

Please sign in to comment.