Skip to content

Commit

Permalink
Merge pull request #465 from oscar-system/bl/onstr
Browse files Browse the repository at this point in the history
gc preserve oscarnumber string
  • Loading branch information
benlorenz authored Jan 4, 2024
2 parents fbee1ca + 03eddb5 commit b9f8d1c
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)
end
end
@generated _on_gen_to_string(::Type{ArgT}) where ArgT =
quote
Expand Down

0 comments on commit b9f8d1c

Please sign in to comment.