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

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

No files matched your search

+5 -4
View File
@@ -44,6 +44,7 @@
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/fast_convert.h"
#include "spandsp/complex.h"
#include "spandsp/dds.h"
@@ -69,7 +70,7 @@ SPAN_DECLARE(tone_gen_descriptor_t *) tone_gen_descriptor_init(tone_gen_descript
{
if (s == NULL)
{
if ((s = (tone_gen_descriptor_t *) malloc(sizeof(*s))) == NULL)
if ((s = (tone_gen_descriptor_t *) span_alloc(sizeof(*s))) == NULL)
{
return NULL;
}
@@ -114,7 +115,7 @@ SPAN_DECLARE(tone_gen_descriptor_t *) tone_gen_descriptor_init(tone_gen_descript
SPAN_DECLARE(void) tone_gen_descriptor_free(tone_gen_descriptor_t *s)
{
free(s);
span_free(s);
}
/*- End of function --------------------------------------------------------*/
@@ -220,7 +221,7 @@ SPAN_DECLARE(tone_gen_state_t *) tone_gen_init(tone_gen_state_t *s, tone_gen_des
if (s == NULL)
{
if ((s = (tone_gen_state_t *) malloc(sizeof(*s))) == NULL)
if ((s = (tone_gen_state_t *) span_alloc(sizeof(*s))) == NULL)
{
return NULL;
}
@@ -252,7 +253,7 @@ SPAN_DECLARE(int) tone_gen_release(tone_gen_state_t *s)
SPAN_DECLARE(int) tone_gen_free(tone_gen_state_t *s)
{
if (s)
free(s);
span_free(s);
return 0;
}
/*- End of function --------------------------------------------------------*/