From 3f31ff836369e615bceffd6a6185870d668dc5ed Mon Sep 17 00:00:00 2001 From: Jared Wahlstrand Date: Sun, 8 Dec 2024 14:27:58 -0500 Subject: [PATCH] fix a few invalidations --- src/GLib/glist.jl | 1 - src/GdkPixbufLib.jl | 1 - src/text.jl | 4 +++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GLib/glist.jl b/src/GLib/glist.jl index 074795c7..e36c5eb7 100644 --- a/src/GLib/glist.jl +++ b/src/GLib/glist.jl @@ -38,7 +38,6 @@ GSList(list::Type{T}) where {T} = GList(convert(Ptr{_GSList{T}}, C_NULL), true) GList(list::Ptr{L}, transfer_full::Bool = false, transfer_container::Bool = true) where {L <: _LList} = GList{L, eltype(L)}(list, transfer_full, transfer_container) const LList{L <: _LList} = Union{Ptr{L}, GList{L}} -eltype(::LList{L}) where {L <: _LList} = eltype(L) _listdatatype(::Type{_LList{T}}) where {T} = T _listdatatype(::Type{L}) where {L <: _LList} = _listdatatype(supertype(L)) diff --git a/src/GdkPixbufLib.jl b/src/GdkPixbufLib.jl index 08e392fe..7682a5cd 100644 --- a/src/GdkPixbufLib.jl +++ b/src/GdkPixbufLib.jl @@ -206,7 +206,6 @@ width(a::MatrixStrided) = a.width height(a::MatrixStrided) = a.height size(a::MatrixStrided, i::Integer) = (i == 1 ? width(a) : (i == 2 ? height(a) : 1)) size(a::MatrixStrided) = (width(a), height(a)) -eltype(a::MatrixStrided{T}) where {T} = T Base.ndims(::MatrixStrided) = 2 # next line was causing invalidations # convert(::Type{P}, a::MatrixStrided) where {P <: Ptr} = convert(P, a.p) diff --git a/src/text.jl b/src/text.jl index b640b7fd..f7d6d351 100644 --- a/src/text.jl +++ b/src/text.jl @@ -4,7 +4,7 @@ GtkTextMark(left_gravity::Bool = false; kwargs...) = GtkTextMark(nothing, left_g GtkTextTag(; kwargs...) = GtkTextTag(nothing; kwargs...) -const TI = Union{Ref{_GtkTextIter}, GtkTextIter} +const TI = Union{Base.RefValue{_GtkTextIter}, GtkTextIter} zero(::Type{_GtkTextIter}) = _GtkTextIter() copy(ti::_GtkTextIter) = Ref(ti) copy(ti::Ref{_GtkTextIter}) = Ref(ti[]) @@ -59,6 +59,8 @@ end ##### _GtkTextIter ##### #TODO: search +# This one (specifically `getproperty(text::RefValue{_GtkTextIter}, key::Symbol)` causes an invalidation +# But I don't see a way of fixing it function getproperty(text::TI, key::Symbol) Base.in(key, fieldnames(typeof(text))) && return getfield(text, key) if key === :offset