FFI ExternalAddress and freeing memory
John M McIntosh
johnmci at smalltalkconsulting.com
Sat Apr 16 23:23:04 UTC 2005
Well if you have this issue you need a weak array object to mange the
external memory, so that when you're
object goes out of scope the finalization of the weakobject allows you
to ensure you have freed things.
Then again as other points out you send release or free to your object
to ensure things get freed.
But programmers are bad at doing this.
On Apr 16, 2005, at 12:19 PM, Martin Kuball wrote:
> If I allocate external memory via ExternalAddress allocate: aNumber
> and the object is GCed. What happens to the allocated memory? I see
> that the class has a method free. But what If I had no chance to call
> it before the object goes out off scope?
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
More information about the Squeak-dev