diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2017-03-03 06:56:21 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2017-03-03 06:56:21 -0500 |
commit | 31c8dbfcf45cd6bbb0f7d47c5b0e69d5948c122c (patch) | |
tree | e665beaeefee3fea44d380e38274f7b379a203ea /coverage/ctracer/datastack.h | |
parent | 65a9b1a16c9b1c38e890213ff7008416cc915158 (diff) | |
download | python-coveragepy-31c8dbfcf45cd6bbb0f7d47c5b0e69d5948c122c.tar.gz |
Simplify stack management in CTracer
"file_data" used to be borrowed from data, but that was confusing. Now it's
owned. We used to have a struct member which was a copy of the current stack
entry. That just made it harder to reason about reference counting. Now we
have a pointer to the entry on the stack.
Diffstat (limited to 'coverage/ctracer/datastack.h')
-rw-r--r-- | coverage/ctracer/datastack.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/coverage/ctracer/datastack.h b/coverage/ctracer/datastack.h index b63af2c..b2dbeb9 100644 --- a/coverage/ctracer/datastack.h +++ b/coverage/ctracer/datastack.h @@ -9,18 +9,16 @@ /* An entry on the data stack. For each call frame, we need to record all * the information needed for CTracer_handle_line to operate as quickly as - * possible. All PyObject* here are borrowed references. + * possible. */ typedef struct DataStackEntry { - /* The current file_data dictionary. Borrowed, owned by self->data. */ + /* The current file_data dictionary. Owned. */ PyObject * file_data; - /* The disposition object for this frame. If collector.py and control.py - * are working properly, this will be an instance of CFileDisposition. - */ + /* The disposition object for this frame. A borrowed instance of CFileDisposition. */ PyObject * disposition; - /* The FileTracer handling this frame, or None if it's Python. */ + /* The FileTracer handling this frame, or None if it's Python. Borrowed. */ PyObject * file_tracer; /* The line number of the last line recorded, for tracing arcs. |