Add the ability to specify that a frame should not be considered for caching

for uses in cases where you *know* that it will do no good.  This patch was
inspired by file for use in some work of his on mixmonitor/chanspy.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-09-03 23:14:54 +00:00
parent 3057660a79
commit 4de3c0e447
2 changed files with 14 additions and 6 deletions

View File

@@ -317,12 +317,12 @@ static void frame_cache_cleanup(void *data)
free(frames);
}
void ast_frfree(struct ast_frame *fr)
void ast_frame_free(struct ast_frame *fr, int cache)
{
if (!fr->mallocd)
return;
if (fr->mallocd == AST_MALLOCD_HDR) {
if (cache && fr->mallocd == AST_MALLOCD_HDR) {
/* Cool, only the header is malloc'd, let's just cache those for now
* to keep things simple... */
struct ast_frame_cache *frames;