More movements of spandsp to the sue of custom allocation routines

This commit is contained in:
Steve Underwood
2013-08-06 01:10:48 +08:00
parent d5e4089c22
commit 799402dd5b
21 changed files with 109 additions and 86 deletions

View File

@@ -35,6 +35,7 @@
#include <stdio.h>
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/async.h"
#include "spandsp/crc.h"
#include "spandsp/bit_operations.h"
@@ -314,7 +315,7 @@ SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s,
{
if (s == NULL)
{
if ((s = (hdlc_rx_state_t *) malloc(sizeof(*s))) == NULL)
if ((s = (hdlc_rx_state_t *) span_alloc(sizeof(*s))) == NULL)
return NULL;
}
memset(s, 0, sizeof(*s));
@@ -350,7 +351,7 @@ SPAN_DECLARE(int) hdlc_rx_release(hdlc_rx_state_t *s)
SPAN_DECLARE(int) hdlc_rx_free(hdlc_rx_state_t *s)
{
free(s);
span_free(s);
return 0;
}
/*- End of function --------------------------------------------------------*/
@@ -592,7 +593,7 @@ SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s,
{
if (s == NULL)
{
if ((s = (hdlc_tx_state_t *) malloc(sizeof(*s))) == NULL)
if ((s = (hdlc_tx_state_t *) span_alloc(sizeof(*s))) == NULL)
return NULL;
}
memset(s, 0, sizeof(*s));
@@ -624,7 +625,7 @@ SPAN_DECLARE(int) hdlc_tx_release(hdlc_tx_state_t *s)
SPAN_DECLARE(int) hdlc_tx_free(hdlc_tx_state_t *s)
{
free(s);
span_free(s);
return 0;
}
/*- End of function --------------------------------------------------------*/