Skip to content

Commit

Permalink
fix a few invalidations
Browse files Browse the repository at this point in the history
  • Loading branch information
jwahlstrand committed Dec 8, 2024
1 parent 32efde4 commit 3f31ff8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/GLib/glist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion src/GdkPixbufLib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/text.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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[])
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3f31ff8

Please sign in to comment.