Confused about erl_free_term

Claes Wikstrom klacke@REDACTED
Wed Jun 7 20:34:41 CEST 2006


Ashok P. Nadkarni wrote:
> I'm confused about allocation/freeing of terms when using the 
> erl_interface library.
> 
> Suppose I have code as follows:
> 
> t1 = erl_decode(blah blah....);
> t2 = erl_hd(t1);
> 
> Once I'm done using t1 and t2, do I have to call erl_free_term for both 
> t1 and t2 ? Or will calling erl_free_term(t1) also free t2? If I do have 
> to call erl_free_term separately for both, could I instead call 
> erl_free_compound(t1) to get the same effect?
>

Yes, call erl_free_compound(t1), only,  that is the
easiest solution.

/klacke

-- 
Claes Wikstrom                        -- Caps lock is nowhere and
http://www.hyber.org                  -- everything is under control
cellphone: +46 70 2097763



More information about the erlang-questions mailing list