Re: [m-users.] MR_GC_free ?
Julien Fischer <[email protected]> Thu, 9 Nov 2023 00:33:43 +1100 (AEDT)
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 8 Nov 2023, Volker Wysk wrote: >> MR_NEW and MR_free allocate and free memory using malloc() and free() >> respectively, not with the GC. It's safer to use the GC versions. >> Additionally, foreign_procs that mix memory allocators, especially a >> manual allocator, is likely be difficult to debug and maintain. > > This leads me to the same question as Peter's answer: Can the garbage > collector see inside a C structure, if it is allocated with MR_GC_NEW? Yes it can. Bear in mind that the Boehm GC is designed to be garbage collector for C; so far as it is concerned there is no distinction between Mercury and C data structures. Julien. _______________________________________________ users mailing list [email protected] https://lists.mercurylang.org/listinfo/users