Skip to content

Commit

Permalink
gc preserve oscarnumber string
Browse files Browse the repository at this point in the history
  • Loading branch information
benlorenz committed Dec 20, 2023
1 parent fbee1ca commit 03eddb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/oscarnumber.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ end


function _on_to_string(e::T) where T
return Cstring(pointer("$e"))
str = "$e"
return GC.@preserve str begin
Base.unsafe_convert(Cstring, str)

Check warning on line 254 in src/oscarnumber.jl

View check run for this annotation

Codecov / codecov/patch

src/oscarnumber.jl#L252-L254

Added lines #L252 - L254 were not covered by tests
end
end
@generated _on_gen_to_string(::Type{ArgT}) where ArgT =
quote
Expand Down

0 comments on commit 03eddb5

Please sign in to comment.