don't mark these allocations as 'cache' allocations when caching has been disabled

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2007-01-04 21:58:42 +00:00
parent 6b1817c0d1
commit 24bb7d865e
2 changed files with 10 additions and 4 deletions

View File

@@ -959,13 +959,17 @@ struct iax_frame *iax_frame_new(int direction, int datalen, unsigned int cacheab
} }
AST_LIST_TRAVERSE_SAFE_END AST_LIST_TRAVERSE_SAFE_END
} }
#endif
if (!fr) { if (!fr) {
if (!(fr = ast_calloc_cache(1, sizeof(*fr) + datalen))) if (!(fr = ast_calloc_cache(1, sizeof(*fr) + datalen)))
return NULL; return NULL;
fr->mallocd_datalen = datalen; fr->mallocd_datalen = datalen;
} }
#else
if (!(fr = ast_calloc(1, sizeof(*fr) + datalen)))
return NULL;
fr->mallocd_datalen = datalen;
#endif
fr->direction = direction; fr->direction = direction;
fr->retrans = -1; fr->retrans = -1;

View File

@@ -300,10 +300,12 @@ static struct ast_frame *ast_frame_header_new(void)
return f; return f;
} }
} }
#endif
if (!(f = ast_calloc_cache(1, sizeof(*f)))) if (!(f = ast_calloc_cache(1, sizeof(*f))))
return NULL; return NULL;
#else
if (!(f = ast_calloc(1, sizeof(*f))))
return NULL;
#endif
f->mallocd_hdr_len = sizeof(*f); f->mallocd_hdr_len = sizeof(*f);
#ifdef TRACE_FRAMES #ifdef TRACE_FRAMES