Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Reduce specialization in GLib methods #552

Merged
merged 3 commits into from
Jan 14, 2021
Merged

Reduce specialization in GLib methods #552

merged 3 commits into from
Jan 14, 2021

Conversation

timholy
Copy link
Member

@timholy timholy commented Jan 2, 2021

A lot of these methods run on non-inferrable argument types.
Consequently it seems to make sense to reduce the amount of
specialization.

Note there's one case with increased specialization, to make it
more reliably inferrable and thus precompilable.

I think all of these make sense, but if anyone can review it I would certainly appreciate it.

A lot of these methods run on non-inferrable argument types.
Consequently it seems to make sense to reduce the amount of
specialization.

Note there's one case with *increased* specialization, to make it
more reliably inferrable and thus precompilable.
@codecov
Copy link

codecov bot commented Jan 2, 2021

Codecov Report

Merging #552 (df5d814) into master (aef0daa) will increase coverage by 0.07%.
The diff coverage is 68.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #552      +/-   ##
==========================================
+ Coverage   47.54%   47.61%   +0.07%     
==========================================
  Files          32       32              
  Lines        2381     2390       +9     
==========================================
+ Hits         1132     1138       +6     
- Misses       1249     1252       +3     
Impacted Files Coverage Δ
src/events.jl 44.18% <0.00%> (ø)
src/GLib/gvalues.jl 86.04% <50.00%> (-1.36%) ⬇️
src/GLib/signals.jl 73.97% <50.00%> (ø)
src/GLib/gtype.jl 77.14% <57.14%> (-0.16%) ⬇️
src/GLib/GLib.jl 72.72% <100.00%> (ø)
src/cairo.jl 70.00% <100.00%> (ø)
src/precompile.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aef0daa...df5d814. Read the comment docs.

@timholy
Copy link
Member Author

timholy commented Jan 12, 2021

I'll merge soon barring objections.

@tknopp
Copy link
Collaborator

tknopp commented Jan 12, 2021

go ahead, I cannot really review that because you are far ahead in knowledge about all this specialization stuff.

@timholy timholy merged commit b61cb23 into master Jan 14, 2021
@timholy timholy deleted the teh/specialization branch January 14, 2021 16:20
timholy added a commit that referenced this pull request Dec 6, 2021
As a consequence of the forced specialization on the `RT` argument
of `signal_emit` in #552, the compiler now knows whether
`RT === Nothing`. In that case, it also knows that
`return_value` will not be used, so it is free to be garbage-collected.
When that happens, it triggers segfaults.

This puts both potential `GValue`-arguments inside a `GC.@preserve`
to prevent garbage collection. Fixes #581.
timholy added a commit that referenced this pull request Dec 6, 2021
As a consequence of the forced specialization on the `RT` argument
of `signal_emit` in #552, the compiler now knows whether
`RT === Nothing`. In that case, it also knows that
`return_value` will not be used, so it is free to be garbage-collected.
When that happens, it triggers segfaults.

This puts both potential `GValue`-arguments inside a `GC.@preserve`
to prevent garbage collection. Fixes #581.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants