-
Notifications
You must be signed in to change notification settings - Fork 131
Commit 2384b95
committed
WIP: trace func threading support, special-casing
line_profiler/_line_profiler.pyx
TraceCallback
Renamed from `CTraceState`
alloc_callback(), free_callback()
New functions for allocating `TraceCallback` objects
c_trace_state_has_hook()
Merged into `call_cached_callback()`
fetch_callback()
- Refactored and renamed from `fetch_c_trace_state()`
- No longer `malloc()`-ing and returning a pointer, instead
assigning to the fields of the pointer passed as the argument
restore_callback()
- Refactored and renamed from `restore_c_trace_state()`
- No longer `free()`-ing the supplied pointer, instead just
assigning `NULL` to its fields
call_callback()
- Merger of `call_c_trace_state_hook[_safe]()`
- Now staying entirely in C-land (where possible), avoiding
calling the `PyObject` attribute-access functions
- Refactored heap-allocated swap `TraceCallback` objects into
stack-allocated ones
- Added check for disabling of the `sys` trace function -- if
that happens, profiling continues (as with before) but the
wrapped/cached callback is no longer called
- Added check for disabling of frame-local line events -- if
that happens, `.f_trace_lines` is restored (as with before)
but the frame-local trace callable (`.f_trace`) is wrapped and
shielded from line events
get_optional_attr(), set_optional_attr()
Removed now-unused methods
disable_line_events()
New Python-level wrapper for shielding a frame-local trace
callable from line events
LineProfiler.wrap_trace
Cythonized definition
LineProfiler.{dis,en}able(), python_trace_callback()
Now handling per-thread caching of the `sys` callback state1 parent 348b19f commit 2384b95Copy full SHA for 2384b95
1 file changed
+191
-160
lines changed
0 commit comments