From 68fb56eb803283f7df9caf2d47c0d39e7be95cbb Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 3 Mar 2017 06:56:21 -0500 Subject: 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. --- coverage/ctracer/datastack.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'coverage/ctracer/datastack.h') 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. -- cgit v1.2.1