Moved a lot of spandsp to the use of custom allocation functions

This commit is contained in:
Steve Underwood
2013-08-06 00:49:15 +08:00
parent 7c744ce1d8
commit d5e4089c22
46 changed files with 233 additions and 187 deletions

View File

@@ -33,6 +33,7 @@
#include <memory.h>
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/schedule.h"
@@ -53,7 +54,7 @@ SPAN_DECLARE(int) span_schedule_event(span_sched_state_t *s, int us, span_sched_
if (i >= s->allocated)
{
s->allocated += 5;
s->sched = (span_sched_t *) realloc(s->sched, sizeof(span_sched_t)*s->allocated);
s->sched = (span_sched_t *) span_realloc(s->sched, sizeof(span_sched_t)*s->allocated);
}
/*endif*/
if (i >= s->max_to_date)
@@ -141,7 +142,7 @@ SPAN_DECLARE(int) span_schedule_release(span_sched_state_t *s)
{
if (s->sched)
{
free(s->sched);
span_free(s->sched);
s->sched = NULL;
}
return 0;
@@ -152,7 +153,7 @@ SPAN_DECLARE(int) span_schedule_free(span_sched_state_t *s)
{
span_schedule_release(s);
if (s)
free(s);
span_free(s);
return 0;
}
/*- End of function --------------------------------------------------------*/