Commit e4f0cb5 Johannes Markert
committed
1 parent 76d5295 commit e4f0cb5 Copy full SHA for e4f0cb5
File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,13 @@ mutable struct ForestWrapper
212
212
end
213
213
end
214
214
215
+ Base. pointer (fw:: ForestWrapper ) = fw. pointer
216
+ # This dispatched conversion allows to directly pass a ForestWrapper object to,
217
+ # for example, `t8_forest_...` call. The following link leads to a lengthy
218
+ # discussion about if this is a valid way to do achieve this:
219
+ # https://discourse.julialang.org/t/how-to-use-ccall-cconvert-and-unsafe-convert-in-a-convenient-and-memory-safe-way/41932/18
220
+ Base. unsafe_convert (:: Type{Ptr{T8code.Libt8.t8_forest}} , fw:: ForestWrapper ) = fw. pointer
221
+
215
222
function clean_up ()
216
223
# Finalize all registered t8code objects before MPI shuts down.
217
224
while length (T8CODE_OBJECT_TRACKER) > 0
You can’t perform that action at this time.
0 commit comments