-
-
Save codehz/18dfd092a5f318bbf13472f046da6661 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc create(): ref RootObj {.dynlib: "b.dll", importc.} | |
block: | |
var x = create() | |
echo cast[int](x) | |
echo "here" | |
GC_fullCollect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type X = object of RootObj | |
proc `=destroy`(x: var X) = | |
echo "destroy" | |
proc create(): ref RootObj {.dynlib, exportc.} = | |
new X |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment