[asterisk-dev] ast_frame allocation/free question

Simon Perreault simon.perreault at viagenie.ca
Tue Nov 27 17:48:05 CST 2007


On Tuesday 27 November 2007 18:23:29 Kevin P. Fleming wrote:
> To answer your question though, there are some channel drivers that are
> #1 and some that are #2.

Ah, thanks. I was under the impression that it was neither. (see below)

> I'm actually not sure why this ever came up, since the (admittedly
> minimal) documentation in channel.h does not give anyone the impression
> that ast_write() takes ownership of the frame. If it did so it would
> certainly be our policy to document such non-obvious behavior.

In my case, it was simply because of the existence of the mallocd member. I 
still don't understand what its role is. In both cases #1 and #2, it doesn't 
matter what value I set it to since the channel won't care. This didn't seem 
to make sense, so that's why I assumed that the channel would use the mallocd 
member and free the frame itself.



More information about the asterisk-dev mailing list