Skip to content

Commit e1d19cf

Browse files
committed
For syscall ABI, reinterpret Ptr{Cvoid} to Clong
Without this, Julia will potentially notice the high bit of the pointer is set and complain about an inexact conversion.
1 parent 360c63c commit e1d19cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/LinuxPerf.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function perf_event_open(attr::perf_event_attr, pid, cpu, leader_fd, flags)
179179
# Have to do a manual conversion, since the ABI is a vararg call
180180
ptr = Base.unsafe_convert(Ptr{Cvoid}, Base.cconvert(Ptr{Cvoid}, r_attr))
181181
fd = ccall(:syscall, Cint, (Clong, Clong...), SYS_perf_event_open,
182-
ptr, pid, cpu, leader_fd, flags)
182+
reinterpret(Clong, ptr), pid, cpu, leader_fd, flags)
183183
end
184184
return fd
185185
end

0 commit comments

Comments
 (0)