@@ -149,7 +149,7 @@ function unsafe_read(from::GenericIOBuffer, p::Ptr{UInt8}, nb::UInt)
149149    from. readable ||  throw (ArgumentError (" read failed, IOBuffer is not readable"  ))
150150    avail =  nb_available (from)
151151    adv =  min (avail, nb)
152-     @gc_preserve  from unsafe_copyto! (p, pointer (from. data, from. ptr), adv)
152+     GC . @preserve  from unsafe_copyto! (p, pointer (from. data, from. ptr), adv)
153153    from. ptr +=  adv
154154    if  nb >  avail
155155        throw (EOFError ())
@@ -164,7 +164,7 @@ function read_sub(from::GenericIOBuffer, a::AbstractArray{T}, offs, nel) where T
164164    end 
165165    if  isbits (T) &&  isa (a,Array)
166166        nb =  UInt (nel *  sizeof (T))
167-         @gc_preserve  a unsafe_read (from, pointer (a, offs), nb)
167+         GC . @preserve  a unsafe_read (from, pointer (a, offs), nb)
168168    else 
169169        for  i =  offs: offs+ nel- 1 
170170            a[i] =  read (to, T)
@@ -395,7 +395,7 @@ function write_sub(to::GenericIOBuffer, a::AbstractArray{UInt8}, offs, nel)
395395    if  offs+ nel- 1  >  length (a) ||  offs <  1  ||  nel <  0 
396396        throw (BoundsError ())
397397    end 
398-     @gc_preserve  a unsafe_write (to, pointer (a, offs), UInt (nel))
398+     GC . @preserve  a unsafe_write (to, pointer (a, offs), UInt (nel))
399399end 
400400
401401@inline  function  write (to:: GenericIOBuffer , a:: UInt8 )
@@ -428,7 +428,7 @@ read(io::GenericIOBuffer, nb::Integer) = read!(io,StringVector(min(nb, nb_availa
428428
429429function  findfirst (delim:: EqualTo{UInt8} , buf:: IOBuffer )
430430    p =  pointer (buf. data, buf. ptr)
431-     q =  @gc_preserve  buf ccall (:memchr ,Ptr{UInt8},(Ptr{UInt8},Int32,Csize_t),p,delim. x,nb_available (buf))
431+     q =  GC . @preserve  buf ccall (:memchr ,Ptr{UInt8},(Ptr{UInt8},Int32,Csize_t),p,delim. x,nb_available (buf))
432432    q ==  C_NULL  &&  return  nothing 
433433    return  Int (q- p+ 1 )
434434end 
@@ -474,7 +474,7 @@ function _crc32c(io::IOBuffer, nb::Integer, crc::UInt32=0x00000000)
474474    io. readable ||  throw (ArgumentError (" read failed, IOBuffer is not readable"  ))
475475    n =  min (nb, nb_available (io))
476476    n ==  0  &&  return  crc
477-     crc =  @gc_preserve  io unsafe_crc32c (pointer (io. data, io. ptr), n, crc)
477+     crc =  GC . @preserve  io unsafe_crc32c (pointer (io. data, io. ptr), n, crc)
478478    io. ptr +=  n
479479    return  crc
480480end 
0 commit comments