admin管理员组文章数量:1356585
In the Haskell GI libraries, there are many functions for freeing memory. For example destFree
in GI.Poppler.Structs.Dest.
Do they really have to be used? Haskell has its own garbage collector, so I would think, I should not be worried about freeing memory. Is it possible, by chance, that those functions are just auto-generated by the GObject introspection mechanism, and should not actually be used?
In the Haskell GI libraries, there are many functions for freeing memory. For example destFree
in GI.Poppler.Structs.Dest.
Do they really have to be used? Haskell has its own garbage collector, so I would think, I should not be worried about freeing memory. Is it possible, by chance, that those functions are just auto-generated by the GObject introspection mechanism, and should not actually be used?
1 Answer
Reset to default 2No. The GI infrastructure connects GHC's garbage collection with glib's reference counting on your behalf, so everything is handled automatically. You can inspect the details in the source. Check out newObject
; almost all the libraries' exported opaque types actually wrap a ManagedPtr
built with this.
本文标签: popplerDo I need to manually free memory when using Haskell GI libraryStack Overflow
版权声明:本文标题:poppler - Do I need to manually free memory when using Haskell GI library? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744066483a2585093.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
free
anything. – cafce25 Commented Mar 27 at 21:54