Skip to content

Commit

Permalink
Fix @GC.preserve -> GC.@preserve (#1663)
Browse files Browse the repository at this point in the history
This old syntax has been deprecated for a long time
  • Loading branch information
fingolfin authored Oct 27, 2024
1 parent 7900721 commit 4cb3cb9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions examples/IsPower.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ function Base.getindex(H::Hecke.HenselCtx, s::Symbol, i::Int)
return unsafe_load(H.link, i)
elseif s == :v
f = Hecke.Globals.Zx()
@GC.preserve f H ccall((:fmpz_poly_set, Nemo.libflint), Cvoid, (Ref{ZZPolyRingElem}, Ptr{Hecke.fmpz_poly_raw}), f, H.v+(i-1)*sizeof(Hecke.fmpz_poly_raw))
GC.@preserve f H ccall((:fmpz_poly_set, Nemo.libflint), Cvoid, (Ref{ZZPolyRingElem}, Ptr{Hecke.fmpz_poly_raw}), f, H.v+(i-1)*sizeof(Hecke.fmpz_poly_raw))
return f
elseif s == :w
f = Hecke.Globals.Zx()
@GC.preserve f H ccall((:fmpz_poly_set, Nemo.libflint), Cvoid, (Ref{ZZPolyRingElem}, Ptr{Hecke.fmpz_poly_raw}), f, H.w+(i-1)*sizeof(Hecke.fmpz_poly_raw))
GC.@preserve f H ccall((:fmpz_poly_set, Nemo.libflint), Cvoid, (Ref{ZZPolyRingElem}, Ptr{Hecke.fmpz_poly_raw}), f, H.w+(i-1)*sizeof(Hecke.fmpz_poly_raw))
return f
end
end
Expand Down
4 changes: 2 additions & 2 deletions src/Misc/Matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ end

# Copy B into A at position (i, j)
function _copy_matrix_into_matrix(A::ZZMatrix, i::Int, j::Int, B::ZZMatrix)
@GC.preserve A B begin
GC.@preserve A B begin
for k in 0:nrows(B) - 1
for l in 0:ncols(B) - 1
d = mat_entry_ptr(B, 1 + k, 1 + l)
Expand All @@ -337,7 +337,7 @@ function _copy_matrix_into_matrix(A::ZZMatrix, i::Int, j::Int, B::ZZMatrix)
end

function _copy_matrix_into_matrix(A::QQMatrix, i::Int, j::Int, B::QQMatrix)
@GC.preserve A B begin
GC.@preserve A B begin
for k in 0:nrows(B) - 1
for l in 0:ncols(B) - 1
d = mat_entry_ptr(B, 1 + k, 1 + l)
Expand Down
28 changes: 14 additions & 14 deletions src/QuadForm/LineOrbits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ end

function _normalize!(x::fpMatrix)
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
piv = 0
local ell
for j in 1:ncols(x)
Expand Down Expand Up @@ -474,7 +474,7 @@ end

function _normalize!(x::MatElem{FpFieldElem})
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
piv = 0
local ell
for j in 1:ncols(x)
Expand Down Expand Up @@ -533,7 +533,7 @@ end

function _isequal(x::fqPolyRepMatrix, y::Vector{fqPolyRepFieldElem})
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
for i in 1:length(y)
el = mat_entry_ptr(x, 1, i)
b = ccall((:fq_nmod_equal, libflint), Cint, (Ref{fqPolyRepFieldElem}, Ptr{fqPolyRepFieldElem}, Ref{fqPolyRepField}), y[i], el, R)
Expand All @@ -548,7 +548,7 @@ end

function _muleq!(x::fqPolyRepMatrix, y::fqPolyRepFieldElem)
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
for i in 1:nrows(x)
for j in 1:ncols(x)
el = mat_entry_ptr(x, i, j)
Expand All @@ -561,7 +561,7 @@ end

function _normalize!(x::fqPolyRepMatrix)
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
piv = 0
local ell
for j in 1:ncols(x)
Expand Down Expand Up @@ -629,7 +629,7 @@ end
function _isless(x::Vector{fqPolyRepFieldElem}, y::fqPolyRepMatrix)
d = length(x)
R = base_ring(y)
@GC.preserve y begin
GC.@preserve y begin
for i in 1:d
xi = x[i]
el = mat_entry_ptr(y, 1, i)
Expand All @@ -655,7 +655,7 @@ end

function _isequal(x::FqPolyRepMatrix, y::Vector{FqPolyRepFieldElem})
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
for i in 1:length(y)
el = mat_entry_ptr(x, 1, i)
b = ccall((:fq_equal, libflint), Cint,
Expand All @@ -671,7 +671,7 @@ end

function _muleq!(x::FqPolyRepMatrix, y::FqPolyRepFieldElem)
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
for i in 1:nrows(x)
for j in 1:ncols(x)
el = mat_entry_ptr(x, i, j)
Expand All @@ -685,7 +685,7 @@ end

function _normalize!(x::FqPolyRepMatrix)
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
piv = 0
local ell
for j in 1:ncols(x)
Expand Down Expand Up @@ -758,7 +758,7 @@ end
function _isless(x::Vector{FqPolyRepFieldElem}, y::FqPolyRepMatrix, tx::ZZRingElem = ZZRingElem(), ty::ZZRingElem = ZZRingElem())
d = length(x)
R = base_ring(y)
@GC.preserve y begin
GC.@preserve y begin
for i in 1:d
xi = x[i]
el = mat_entry_ptr(y, 1, i)
Expand Down Expand Up @@ -791,7 +791,7 @@ end

function _isequal(x::FqMatrix, y::Vector{FqFieldElem})
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
for i in 1:length(y)
el = mat_entry_ptr(x, 1, i)
b = ccall((:fq_default_equal, libflint), Cint,
Expand All @@ -807,7 +807,7 @@ end

function _muleq!(x::FqMatrix, y::FqFieldElem)
R = base_ring(x)
@GC.preserve x begin
GC.@preserve x begin
for i in 1:nrows(x)
for j in 1:ncols(x)
el = Nemo.fq_default_mat_entry_ptr(x, i, j)
Expand All @@ -823,7 +823,7 @@ function _normalize!(x::FqMatrix)
R = base_ring(x)
piv = 0
local ell
@GC.preserve x begin
GC.@preserve x begin
for j in 1:ncols(x)
el = Nemo.fq_default_mat_entry_ptr(x, 1, j)
b = ccall((:fq_default_is_zero, libflint), Cint,
Expand Down Expand Up @@ -895,7 +895,7 @@ end
function _isless(x::Vector{FqFieldElem}, y::FqMatrix, tx::ZZRingElem = ZZRingElem(), ty::ZZRingElem = ZZRingElem())
d = length(x)
R = base_ring(y)
@GC.preserve y begin
GC.@preserve y begin
for i in 1:d
xi = x[i]
el = Nemo.fq_default_mat_entry_ptr(y, 1, i)
Expand Down

0 comments on commit 4cb3cb9

Please sign in to comment.