From: Kevin P. Fleming Date: Thu, 4 Jan 2007 21:58:42 +0000 (+0000) Subject: don't mark these allocations as 'cache' allocations when caching has been disabled X-Git-Tag: 1.4.1~332 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=24bb7d865eb8caf7d3ac553e65a4cbb38bf45a23;p=thirdparty%2Fasterisk.git 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 --- diff --git a/channels/iax2-parser.c b/channels/iax2-parser.c index 319d4caaa9..35575c9889 100644 --- a/channels/iax2-parser.c +++ b/channels/iax2-parser.c @@ -959,13 +959,17 @@ struct iax_frame *iax_frame_new(int direction, int datalen, unsigned int cacheab } AST_LIST_TRAVERSE_SAFE_END } -#endif - if (!fr) { if (!(fr = ast_calloc_cache(1, sizeof(*fr) + datalen))) return NULL; fr->mallocd_datalen = datalen; } +#else + if (!(fr = ast_calloc(1, sizeof(*fr) + datalen))) + return NULL; + fr->mallocd_datalen = datalen; +#endif + fr->direction = direction; fr->retrans = -1; diff --git a/main/frame.c b/main/frame.c index 0cf11981fe..83599fff87 100644 --- a/main/frame.c +++ b/main/frame.c @@ -300,10 +300,12 @@ static struct ast_frame *ast_frame_header_new(void) return f; } } -#endif - if (!(f = ast_calloc_cache(1, sizeof(*f)))) return NULL; +#else + if (!(f = ast_calloc(1, sizeof(*f)))) + return NULL; +#endif f->mallocd_hdr_len = sizeof(*f); #ifdef TRACE_FRAMES