From a9eff6c5e9e786e5531c30f83c8c6d96d72a6310 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 6 Jul 2012 13:35:28 -0400 Subject: [PATCH] un-FIXME: Can't use freeList for variable length allocations --- src/ioc/db/chfPlugin.c | 7 +++---- src/ioc/db/dbChannel.c | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/ioc/db/chfPlugin.c b/src/ioc/db/chfPlugin.c index 23bfdc6f9..8c6260789 100644 --- a/src/ioc/db/chfPlugin.c +++ b/src/ioc/db/chfPlugin.c @@ -300,7 +300,7 @@ static int store_string_value(const chfPluginArgDef *opt, void *user, const char static void freeInstanceData(chfFilter *f) { - free(f->found); /* FIXME: Use a free-list */ + free(f->found); free(f); /* FIXME: Use a free-list */ } @@ -326,7 +326,6 @@ static parse_result parse_start(chFilter *filter) f->nextParam = -1; /* Bit array to find missing required keys */ - /* FIXME: Use a free-list */ f->found = calloc( (p->nopts/32)+1, sizeof(epicsUInt32) ); if (!f->found) { fprintf(stderr,"chfConfigParseStart: bit array calloc failed\n"); @@ -344,7 +343,7 @@ static parse_result parse_start(chFilter *filter) return parse_continue; errplugin: - free(f->found); /* FIXME: Use a free-list */ + free(f->found); errbitarray: free(f); /* FIXME: Use a free-list */ errfctx: @@ -519,7 +518,7 @@ static void channel_close(chFilter *filter) if (p->pif->channel_close) p->pif->channel_close(filter->chan, f->puser); if (p->pif->freePvt) p->pif->freePvt(f->puser); - free(f->found); /* FIXME: Use a free-list */ + free(f->found); free(f); /* FIXME: Use a free-list */ } diff --git a/src/ioc/db/dbChannel.c b/src/ioc/db/dbChannel.c index 98fa9b70e..67f7a8018 100644 --- a/src/ioc/db/dbChannel.c +++ b/src/ioc/db/dbChannel.c @@ -232,17 +232,17 @@ static const yajl_parser_config chf_config = static void * chf_malloc(void *ctx, unsigned int sz) { - return malloc(sz); /* FIXME: free-list */ + return malloc(sz); } static void * chf_realloc(void *ctx, void *ptr, unsigned int sz) { - return realloc(ptr, sz); /* FIXME: free-list */ + return realloc(ptr, sz); } static void chf_free(void *ctx, void *ptr) { - return free(ptr); /* FIXME: free-list */ + return free(ptr); } static const yajl_alloc_funcs chf_alloc = @@ -464,7 +464,7 @@ dbChannel * dbChannelCreate(const char *name) /* FIXME: Use free-list */ chan = (dbChannel *) callocMustSucceed(1, sizeof(*chan), "dbChannelCreate"); - chan->name = epicsStrDup(name); /* FIXME: free-list */ + chan->name = epicsStrDup(name); ellInit(&chan->filters); ellInit(&chan->pre_chain); ellInit(&chan->post_chain); @@ -715,7 +715,7 @@ void dbChannelDelete(dbChannel *chan) filter->plug->fif->channel_close(filter); free(filter); } - free((char *) chan->name); /* FIXME: Use free-list */ + free((char *) chan->name); free(chan); /* FIXME: Use free-list */ }