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 | 68fb56eb803283f7df9caf2d47c0d39e7be95cbb (patch) | |
tree | dd473a0ae57e68589de94e267a898b7d299e6226 /coverage/ctracer/datastack.h | |
parent | 0c38af32a0cada8d35671adff86c871d3badb37a (diff) | |
download | python-coveragepy-git-68fb56eb803283f7df9caf2d47c0d39e7be95cbb.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 b63af2c5..b2dbeb95 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. |