[m-rev.] for review: Fix unexpected memory retention by mvars.

Julien Fischer jfischer at opturion.com
Thu Apr 11 12:42:59 AEST 2013


Hi Peter,

On Thu, Apr 11, 2013 at 12:33 PM, Peter Wang <novalazy at gmail.com> wrote:
> Even after "taking" a value out of an mvar, the reference to the value
> actually still remained.  This may lead to higher than expected memory
> usage.
>
> (Aside: putting a dummy value into an mvar is a bad idea and unsolved by
> this change.  In low-level C grades whatever value happened to be in the
> register for the value argument in the mvar.put call will be placed into
> the mvar, and it might point to some large value which is otherwise
> collectable.)
>
> library/thread.mvar.m:
>         Make mvar.take and mvar.try_take clear the underlying mutvar
>         after retrieving the value.
>
> library/mutvar.m:
>         Add clear_mutvar in support.

That's fine.

Cheers,
Julien.



More information about the reviews mailing list