Skip to content

Commit

Permalink
Fix InterpreterIP reference (timholy#404)
Browse files Browse the repository at this point in the history
* Fix InterpreterIP reference

* fix CI arch on macos

* test nightly
  • Loading branch information
IanButterworth authored Nov 24, 2024
1 parent 41b506e commit ae3aad4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ jobs:
- '1.10'
- '1'
- 'pre'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
show-versioninfo: ${{ matrix.version == 'nightly' }}
- uses: actions/cache@v4
env:
Expand Down
7 changes: 6 additions & 1 deletion src/parcel_snoop_inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ isROOT(node::InferenceTimingNode) = isROOT(node.mi_timing)
getroot(node::InferenceTimingNode) = isdefined(node.parent, :parent) ? getroot(node.parent) : node

# Record instruction pointers we've already looked up (performance optimization)
const lookups = Dict{Union{UInt, Core.Compiler.InterpreterIP}, Vector{StackTraces.StackFrame}}()
const lookups = if isdefined(Core.Compiler, :InterpreterIP)
Dict{Union{UInt, Core.Compiler.InterpreterIP}, Vector{StackTraces.StackFrame}}()
else
# Julia 1.12+
Dict{Union{UInt, Base.InterpreterIP}, Vector{StackTraces.StackFrame}}()
end
lookups_key(ip) = ip
lookups_key(ip::Ptr{Nothing}) = UInt(ip)

Expand Down

0 comments on commit ae3aad4

Please sign in to comment.