free problems and memory management
brian <briand-/[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
free is still causing bus errors and illegal instructions on MAC OS X (PPC) The odd thing is that creating my own version of malloc and free seems to work just fine, so I have to assume that the fix is trivial. If someone can give me a clue as to where to look in the source I'm happy to try some things to fix the problem. In the meantime, the "custom" malloc and free should be OK. However this brings up the very painful subject of memory management (a curse on C !). A lot of C pointers which need to be created are temporary and usually used to go back and forth between C and SML. However some of them have a "lifetime" beyond a single procedure. Is there any clever way of coding which could somehow tie free for that object into the GC somehow, so that when the object is free'ed. I supposed this is something along the lines of what I have heard referred to as a "finalized", maybe ? Thanks Brian