[asterisk-dev] ast_frame allocation/free question

Kevin P. Fleming kpfleming at digium.com
Wed Nov 28 08:47:29 CST 2007


Sergio Garcia Murillo wrote:

> And that's exactly the source of all the misundestanding, if there's a 
> member of the structure to record which parts of the frame I have allocated
> and I see that ast_frame_free frees the frame based on that, it's a logical
> step to think that if I correctly set the value someone is going to free the
> frames for me. I mean, I don't need to check the mallocd of a frame to 
> know what do I have allocated a few lines before.. :)

No, that is not a logical assumption. It's a logical assumption that if
you set those flags the proper things will happen when ast_frame_free()
is called to handle your frame, but there is no implication that any
sort of automagic handling of the frame will occur (because that is not
possible without reference counting).

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)



More information about the asterisk-dev mailing list